* {
  box-sizing: border-box;
}

:root {
  --bg: #f8f5ef;
  --paper: rgba(255, 255, 255, 0.86);
  --paper-strong: #fffaf3;
  --ink: #172033;
  --muted: #6b7280;
  --line: rgba(23, 32, 51, 0.1);
  --brand: #ec4899;
  --brand-2: #f97316;
  --green: #16a34a;
  --teal: #0f766e;
  --shadow: 0 24px 60px rgba(84, 54, 25, 0.12);
  --radius: 28px;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at 15% 10%, rgba(236, 72, 153, 0.14), transparent 30%),
    radial-gradient(circle at 85% 0%, rgba(249, 115, 22, 0.14), transparent 32%),
    linear-gradient(180deg, #fffaf4 0%, var(--bg) 46%, #ffffff 100%);
  line-height: 1.65;
}

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

.preview-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.preview-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(18px);
  background: rgba(255, 250, 244, 0.78);
  border-bottom: 1px solid var(--line);
}

.preview-nav__inner {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) 120px;
  align-items: center;
  gap: 18px;
  min-height: 70px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 220px;
  font-weight: 900;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 12px 28px rgba(236, 72, 153, 0.28);
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #4b5563;
  font-size: 14px;
}

.nav-links a {
  padding: 8px 12px;
  border-radius: 999px;
}

.nav-links a:hover,
.nav-links .is-active {
  background: rgba(236, 72, 153, 0.1);
  color: var(--brand);
}

.utility-menu {
  position: relative;
  flex: 0 0 auto;
  justify-self: end;
}

.utility-menu summary {
  list-style: none;
  min-width: 84px;
  padding: 9px 16px;
  border: 1px solid rgba(20, 184, 166, 0.28);
  border-radius: 999px;
  color: #0f766e;
  background: linear-gradient(135deg, rgba(45, 212, 191, 0.95), rgba(103, 232, 249, 0.86));
  font-size: 13px;
  font-weight: 900;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(20, 184, 166, 0.2);
}

.utility-menu summary::-webkit-details-marker {
  display: none;
}

.utility-menu[open] summary {
  color: #fff;
  background: linear-gradient(135deg, #14b8a6, #06b6d4);
}

.utility-menu__panel {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  z-index: 30;
  width: min(520px, calc(100vw - 32px));
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(240, 253, 250, 0.94)),
    radial-gradient(circle at 92% 8%, rgba(45, 212, 191, 0.18), transparent 36%);
  box-shadow: 0 28px 70px rgba(15, 23, 42, 0.18);
  backdrop-filter: blur(18px);
}

.utility-menu__panel a {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid rgba(20, 184, 166, 0.12);
  border-radius: 14px;
  color: #164e63;
  background: rgba(255, 255, 255, 0.76);
  font-size: 13px;
  font-weight: 800;
}

.utility-menu__panel a:hover {
  transform: translateY(-1px);
  border-color: rgba(20, 184, 166, 0.32);
  background: rgba(236, 254, 255, 0.95);
  box-shadow: 0 12px 24px rgba(15, 118, 110, 0.12);
}

.tool-hero {
  padding: 44px 0 26px;
}

.tool-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(320px, 0.68fr);
  gap: 28px;
  align-items: end;
}

.tool-hero-grid--single {
  grid-template-columns: minmax(0, 760px);
}

body[data-preview-tool="second-contract"] .tool-hero-grid--single {
  grid-template-columns: minmax(0, 980px);
}

body[data-preview-tool="second-contract"] .tool-hero h1 {
  white-space: nowrap;
}

body[data-preview-tool="calculator"] .tool-hero-grid--single {
  grid-template-columns: minmax(0, 1040px);
}

body[data-preview-tool="calculator"] .tool-hero h1 {
  max-width: none;
  white-space: nowrap;
  font-size: clamp(36px, 4.45vw, 58px);
  letter-spacing: -0.06em;
}

.tool-hero h1 {
  margin: 16px 0 12px;
  font-size: clamp(36px, 5vw, 62px);
  line-height: 1.04;
  letter-spacing: -0.055em;
}

.tool-hero h1 span {
  color: var(--brand);
}

.tool-page-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
}

.tool-workbench {
  padding: clamp(18px, 3vw, 28px);
  border: 1px solid rgba(255,255,255,0.78);
  border-radius: 34px;
  background:
    linear-gradient(145deg, rgba(255,255,255,0.92), rgba(255,250,245,0.72)),
    radial-gradient(circle at 100% 0%, rgba(236,72,153,0.12), transparent 34%);
  box-shadow: 0 28px 80px rgba(84,54,25,0.13);
}

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

.fx-form-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1.25fr) minmax(170px, 1fr) minmax(170px, 1fr) minmax(128px, 0.45fr);
  gap: 14px;
  align-items: end;
}

.tool-field {
  display: grid;
  gap: 7px;
}

.tool-field label {
  color: #4b5563;
  font-size: 13px;
  font-weight: 900;
}

.tool-input,
.tool-select,
.tool-textarea {
  width: 100%;
  border: 1px solid rgba(23,32,51,0.1);
  border-radius: 16px;
  background: rgba(255,255,255,0.9);
  color: var(--ink);
  font: inherit;
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.72);
}

.tool-input,
.tool-select {
  min-height: 46px;
  padding: 0 14px;
}

.tool-textarea {
  min-height: 180px;
  padding: 14px;
  resize: vertical;
  line-height: 1.65;
}

.tool-input:focus,
.tool-select:focus,
.tool-textarea:focus {
  border-color: rgba(236,72,153,0.38);
  box-shadow: 0 0 0 4px rgba(236,72,153,0.1);
}

.tool-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.fx-action-field .btn {
  width: 100%;
  min-height: 46px;
  justify-content: center;
}

.tool-result {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid rgba(23,32,51,0.08);
  border-radius: 24px;
  background: rgba(255,255,255,0.74);
}

.tool-result h3 {
  margin: 0 0 10px;
}

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

.media-extract-workbench {
  max-width: 980px;
  margin: 0 auto;
}

.media-url-input {
  min-height: 116px;
}

.media-result[data-mode="ok"] {
  border-color: rgba(20, 184, 166, 0.22);
  background:
    linear-gradient(135deg, rgba(240, 253, 250, 0.9), rgba(255, 255, 255, 0.82)),
    radial-gradient(circle at 100% 0%, rgba(20, 184, 166, 0.1), transparent 32%);
}

.media-result[data-mode="error"] {
  border-color: rgba(225, 29, 72, 0.2);
  background: linear-gradient(135deg, rgba(255, 241, 242, 0.92), rgba(255, 255, 255, 0.82));
  color: #be123c;
}

.media-post-text {
  margin-bottom: 16px;
  padding: 14px 16px;
  border: 1px solid rgba(23, 32, 51, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
}

.media-post-text p {
  margin: 0;
  color: #334155;
  white-space: pre-wrap;
  line-height: 1.75;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

.media-card {
  overflow: hidden;
  border: 1px solid rgba(23, 32, 51, 0.08);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.08);
}

.media-preview {
  min-height: 180px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #111827, #312e81);
}

.media-preview-zoom {
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

.media-preview img,
.media-preview video {
  width: 100%;
  height: 230px;
  display: block;
  object-fit: contain;
  background: #0f172a;
}

.media-file-placeholder {
  width: 78px;
  height: 78px;
  display: grid;
  place-items: center;
  border-radius: 24px;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.14);
  font-weight: 900;
  letter-spacing: 0.12em;
}

.media-card__body {
  display: grid;
  gap: 8px;
  padding: 14px;
}

.media-card__body strong {
  color: var(--ink);
  font-size: 15px;
}

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

.media-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.media-card__actions .btn {
  min-height: 38px;
  padding: 9px 12px;
  font-size: 12px;
}

.media-preview-open {
  overflow: hidden;
}

.media-preview-modal {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(20, 14, 18, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.media-preview-modal[hidden] {
  display: none !important;
}

.media-preview-modal__img {
  max-width: min(96vw, 1280px);
  max-height: 90vh;
  display: block;
  object-fit: contain;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 34px 110px rgba(0, 0, 0, 0.38);
  cursor: zoom-out;
}

.media-preview-modal__close {
  position: fixed;
  top: 20px;
  right: 22px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: #111827;
  font-size: 28px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.18);
}

.vault-workbench {
  width: 100%;
  max-width: 1360px;
  margin: 0 auto;
  padding: clamp(22px, 2.5vw, 36px);
}

body[data-preview-tool="vault"] .preview-shell {
  width: min(1480px, calc(100% - 56px));
}

.vault-toolbar,
.vault-editor-head,
.vault-images-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.vault-toolbar {
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(23, 32, 51, 0.08);
}

.vault-toolbar strong,
.vault-images-head strong {
  display: block;
  color: var(--ink);
  font-size: 18px;
  font-weight: 900;
}

.vault-toolbar span,
.vault-images-head span,
.vault-parent-hint {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.6;
}

.vault-toolbar-actions {
  margin-top: 0;
  flex-shrink: 0;
}

.jiyu-vault-status {
  min-height: 22px;
  margin: 12px 0;
  color: #0f766e;
  font-size: 13px;
  font-weight: 900;
}

.jiyu-vault-status[data-tone="error"] {
  color: #be123c;
}

.vault-layout {
  display: grid;
  grid-template-columns: minmax(230px, 286px) minmax(0, 1fr);
  gap: 22px;
  min-height: 680px;
}

.vault-sidebar,
.vault-editor-wrap {
  border: 1px solid rgba(23, 32, 51, 0.08);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.vault-sidebar {
  overflow: auto;
  padding: 12px;
}

.jiyu-vault-nav-empty {
  margin: 8px;
  color: var(--muted);
  font-size: 13px;
}

.jiyu-vault-nav-row {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 6px;
  align-items: center;
  margin-bottom: 8px;
}

.jiyu-vault-nav-row.is-dragging {
  opacity: 0.45;
}

.jiyu-vault-nav-caret,
.jiyu-vault-nav-caret-placeholder {
  width: 24px;
  height: 32px;
  border: 0;
  background: transparent;
  color: #9ca3af;
  cursor: pointer;
}

.jiyu-vault-nav-item {
  width: 100%;
  min-height: 38px;
  border: 1px solid rgba(23, 32, 51, 0.08);
  border-radius: 14px;
  padding: 0 12px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.86);
  color: #374151;
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.jiyu-vault-nav-item[aria-selected="true"] {
  border-color: rgba(236, 72, 153, 0.28);
  color: #be185d;
  background: linear-gradient(135deg, rgba(255, 241, 247, 0.94), rgba(255, 255, 255, 0.9));
  box-shadow: 0 12px 26px rgba(236, 72, 153, 0.08);
}

.vault-editor-wrap {
  min-width: 0;
  padding: 24px;
}

.vault-empty {
  min-height: 440px;
  display: grid;
  place-content: center;
  gap: 6px;
  color: var(--muted);
  text-align: center;
}

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

.vault-editor {
  display: grid;
  gap: 12px;
}

.vault-title-input,
.vault-body-input {
  width: 100%;
  border: 1px solid rgba(23, 32, 51, 0.1);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  font: inherit;
  outline: none;
}

.vault-title-input {
  min-height: 46px;
  padding: 0 14px;
  font-size: 16px;
  font-weight: 900;
}

.vault-body-input {
  min-height: 430px;
  padding: 20px;
  font-size: 16px;
  line-height: 1.85;
  resize: vertical;
}

.vault-title-input:focus,
.vault-body-input:focus {
  border-color: rgba(236, 72, 153, 0.38);
  box-shadow: 0 0 0 4px rgba(236, 72, 153, 0.1);
}

.vault-editor-actions {
  margin-top: 0;
  flex-shrink: 0;
}

.vault-images {
  display: grid;
  gap: 12px;
  margin-top: 8px;
  padding: 14px;
  border: 1px solid rgba(20, 184, 166, 0.14);
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(240, 253, 250, 0.72), rgba(255, 255, 255, 0.72));
}

.vault-image-drop {
  padding: 16px;
  border: 1px dashed rgba(20, 184, 166, 0.35);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  color: #0f766e;
  font-size: 13px;
  font-weight: 900;
  text-align: center;
}

.vault-image-drop.is-dragover {
  border-color: rgba(236, 72, 153, 0.45);
  background: rgba(255, 241, 247, 0.8);
}

.vault-image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}

.jiyu-vault-image-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(23, 32, 51, 0.08);
  border-radius: 16px;
  background: #fff;
}

.jiyu-vault-image-card img {
  width: 100%;
  height: 112px;
  display: block;
  object-fit: cover;
}

.jiyu-vault-image-card__name {
  padding: 7px 8px;
  overflow: hidden;
  color: #4b5563;
  font-size: 11px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.jiyu-vault-image-card__del {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: rgba(190, 18, 60, 0.9);
  cursor: pointer;
}

.vault-modal[hidden],
.vault-modal.hidden,
.hidden {
  display: none !important;
}

.vault-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 18px;
}

.vault-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(24, 18, 22, 0.36);
  backdrop-filter: blur(5px);
}

.vault-modal__box {
  position: relative;
  z-index: 1;
  width: min(460px, 100%);
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 30px 90px rgba(88, 28, 55, 0.24);
}

.vault-modal__box h3 {
  margin: 0 0 8px;
}

.vault-modal__box p {
  margin: 0 0 16px;
  color: #4b5563;
}

.preview-pixel-modal-open {
  overflow: hidden;
}

.preview-pixel-img-modal {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(20, 14, 18, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.preview-pixel-img-modal[hidden] {
  display: none !important;
}

.preview-pixel-img-modal__img {
  max-width: min(96vw, 1280px);
  max-height: 90vh;
  display: block;
  object-fit: contain;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 34px 110px rgba(0, 0, 0, 0.38);
  cursor: zoom-out;
}

.preview-pixel-img-modal__close {
  position: fixed;
  top: 20px;
  right: 22px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: #111827;
  font-size: 28px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.18);
}

.vault-image-preview__box {
  width: min(860px, 100%);
}

.vault-image-preview__box img {
  max-width: 100%;
  max-height: 72vh;
  display: block;
  margin: 0 auto;
  border-radius: 18px;
}

.vault-image-preview__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.76);
  color: #fff;
  cursor: pointer;
}

@media (max-width: 980px) {
  body[data-preview-tool="vault"] .preview-shell {
    width: min(100% - 28px, 1480px);
  }

  .vault-layout {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .vault-sidebar {
    max-height: 280px;
  }

  .vault-body-input {
    min-height: 360px;
  }
}

@media (max-width: 860px) {
  .fx-form-grid {
    grid-template-columns: 1fr 1fr;
  }

  .fx-action-field {
    grid-column: 1 / -1;
  }
}

.tool-stat {
  padding: 14px;
  border-radius: 18px;
  background: rgba(255,255,255,0.78);
  border: 1px solid rgba(23,32,51,0.07);
}

.tool-stat strong {
  display: block;
  font-size: 24px;
  line-height: 1.15;
}

.tool-stat span {
  color: var(--muted);
  font-size: 12px;
}

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

.tool-list-item {
  display: grid;
  grid-template-columns: 140px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid rgba(23,32,51,0.08);
  border-radius: 18px;
  background: rgba(255,255,255,0.72);
}

.tool-iframe {
  width: 100%;
  min-height: 680px;
  border: 0;
  border-radius: 24px;
  background: #fff;
  opacity: 0;
  box-shadow: inset 0 0 0 1px rgba(23,32,51,0.08);
  transition: opacity 0.16s ease;
}

.tool-iframe.is-ready {
  opacity: 1;
}

.tool-note {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
}

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

.second-tier {
  min-height: 54px;
  padding: 10px 8px;
  border: 1px solid rgba(225, 29, 138, 0.16);
  border-radius: 16px;
  background: rgba(255,255,255,0.78);
  color: #4b5563;
  cursor: pointer;
  font: inherit;
  transition: 0.18s ease;
}

.second-tier strong,
.second-tier span {
  display: block;
}

.second-tier strong {
  color: #111827;
  font-size: 15px;
}

.second-tier span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.second-tier.is-on,
.second-tier:hover {
  transform: translateY(-1px);
  border-color: rgba(225, 29, 138, 0.32);
  background: linear-gradient(180deg, #fff, #fff1f7);
  box-shadow: 0 14px 34px rgba(225, 29, 138, 0.12);
}

.second-result-card {
  margin-top: 20px;
  padding: 18px;
  border: 1px solid rgba(17, 24, 39, 0.08);
  border-radius: 24px;
  background: rgba(255,255,255,0.78);
}

.second-result-card h3 {
  margin: 0 0 10px;
  font-size: 16px;
}

.second-result-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.second-result-table th,
.second-result-table td {
  padding: 12px 10px;
  border-bottom: 1px solid rgba(17, 24, 39, 0.07);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.second-result-table th:first-child,
.second-result-table td:first-child {
  text-align: left;
}

.second-result-table thead th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.second-result-table tfoot td {
  border-bottom: none;
  color: #9d174d;
  font-size: 16px;
  font-weight: 900;
}

.second-profit-label {
  display: inline-block;
  margin-right: 12px;
  color: #0f766e;
  font-size: 13px;
  font-weight: 900;
}

.second-result-table tfoot strong {
  color: #9d174d;
  font: inherit;
}

.calc-display {
  min-height: 104px;
  padding: 20px 24px;
  border-radius: 28px;
  background: #111827;
  color: #fff;
  text-align: right;
  overflow: hidden;
}

.calc-display small {
  display: block;
  min-height: 24px;
  color: rgba(255,255,255,0.58);
  font-size: 15px;
}

.calc-display strong {
  display: block;
  font-size: 46px;
  line-height: 1.1;
}

.calc-workbench {
  width: min(100%, 680px);
  margin: 0 auto;
  padding: clamp(26px, 3.4vw, 40px);
  border-radius: 42px;
  box-shadow: 0 34px 95px rgba(84, 54, 25, 0.16);
}

.calc-keys {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-top: 18px;
}

.calc-key {
  min-height: 72px;
  border: 1px solid rgba(23,32,51,0.08);
  border-radius: 24px;
  background: rgba(255,255,255,0.86);
  color: var(--ink);
  font: inherit;
  font-size: 19px;
  font-weight: 900;
  cursor: pointer;
}

.calc-key.is-op,
.calc-key.is-eq {
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
}

.tool-embed-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.hero {
  padding: 56px 0 32px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
  gap: 32px;
  align-items: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 999px;
  color: #be185d;
  background: rgba(236, 72, 153, 0.1);
  font-size: 13px;
  font-weight: 800;
}

.hero h1 {
  margin: 18px 0 16px;
  font-size: clamp(36px, 6vw, 66px);
  line-height: 1.04;
  letter-spacing: -0.05em;
}

.hero h1 span {
  color: var(--brand);
}

.lead {
  margin: 0;
  max-width: 680px;
  color: #4b5563;
  font-size: 18px;
}

.hero-actions,
.section-actions,
.chat-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 10px 26px rgba(17, 24, 39, 0.06);
}

.btn-primary {
  border: none;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
}

.btn-green {
  border: none;
  color: #fff;
  background: linear-gradient(135deg, var(--green), var(--teal));
}

.hero-card {
  position: relative;
  overflow: hidden;
  padding: 22px;
  border: 1px solid rgba(236, 72, 153, 0.15);
  border-radius: 34px;
  background: linear-gradient(160deg, rgba(255,255,255,0.94), rgba(255,245,249,0.9));
  box-shadow: var(--shadow);
}

.chat-preview {
  display: grid;
  gap: 14px;
}

.bubble {
  max-width: 88%;
  padding: 14px 16px;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 12px 32px rgba(17, 24, 39, 0.08);
  font-size: 14px;
}

.bubble.user {
  justify-self: end;
  color: #fff;
  background: linear-gradient(135deg, #ec4899, #f97316);
}

.bubble.ai {
  justify-self: start;
  border-top-left-radius: 6px;
}

.bubble small {
  display: block;
  margin-top: 6px;
  color: rgba(255,255,255,0.82);
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 18px;
}

.metric {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255,255,255,0.72);
}

.metric strong {
  display: block;
  font-size: 20px;
}

.metric span {
  color: var(--muted);
  font-size: 12px;
}

.section {
  padding: 36px 0;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.section-title {
  margin: 0;
  font-size: clamp(26px, 3vw, 38px);
  letter-spacing: -0.03em;
}

.section-sub {
  margin: 8px 0 0;
  max-width: 760px;
  color: var(--muted);
}

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

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

.card-grid--four .card {
  padding: 20px;
  min-width: 0;
}

.card-grid--four .card h3 {
  font-size: 18px;
}

.card-grid--four .card p {
  font-size: 13px;
  line-height: 1.6;
}

.card-grid--four .tag-row {
  gap: 6px;
}

.card-grid--four .tag {
  padding: 4px 8px;
  font-size: 11px;
}

.rpa-download-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 0.8fr);
  gap: 20px;
  align-items: center;
  margin-top: 24px;
  padding: clamp(20px, 3vw, 30px);
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 34px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(255, 247, 242, 0.72)),
    radial-gradient(circle at 100% 0%, rgba(20, 184, 166, 0.14), transparent 36%);
  box-shadow: 0 24px 70px rgba(84, 54, 25, 0.12);
}

.rpa-download-panel h3 {
  margin: 12px 0 8px;
  font-size: clamp(24px, 3vw, 38px);
  line-height: 1.08;
  letter-spacing: -0.045em;
}

.rpa-download-panel p {
  margin: 0;
  max-width: 620px;
  color: #4b5563;
}

.rpa-download-actions {
  display: grid;
  gap: 12px;
}

.rpa-download-card {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 4px;
  min-height: 88px;
  padding: 18px 20px;
  border-radius: 24px;
  color: #fff;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.13);
}

.rpa-download-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 92% 12%, rgba(255,255,255,0.34), transparent 32%);
  pointer-events: none;
}

.rpa-download-card strong {
  position: relative;
  z-index: 1;
  font-size: 20px;
  line-height: 1.2;
}

.rpa-download-card span {
  position: relative;
  z-index: 1;
  color: rgba(255,255,255,0.82);
  font-size: 13px;
}

.rpa-download-card--win {
  background: linear-gradient(135deg, #2563eb, #06b6d4);
}

.rpa-download-card--mac {
  background: linear-gradient(135deg, #111827, #ec4899);
}

.rpa-download-card:hover {
  transform: translateY(-2px);
}

.rpa-download-dialog[hidden] {
  display: none !important;
}

.rpa-download-dialog {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 24px;
}

.rpa-download-dialog__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(24, 18, 22, 0.36);
  backdrop-filter: blur(5px);
}

.rpa-download-dialog__panel {
  position: relative;
  z-index: 1;
  width: min(560px, calc(100vw - 32px));
  border: 1px solid rgba(255,255,255,0.78);
  border-radius: 30px;
  padding: 22px;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.98), rgba(255,247,250,0.94)),
    radial-gradient(circle at 100% 0%, rgba(20,184,166,0.13), transparent 34%);
  box-shadow: 0 30px 90px rgba(88, 28, 55, 0.24);
}

.rpa-download-dialog__head,
.rpa-download-dialog__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.rpa-download-dialog__head {
  margin-bottom: 16px;
  color: var(--ink);
  font-size: 18px;
}

.rpa-download-dialog__head button {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  color: #9d174d;
  background: #fff1f7;
  font-size: 22px;
  cursor: pointer;
}

.rpa-download-dialog__body {
  display: grid;
  gap: 12px;
  color: #445066;
  line-height: 1.75;
}

.rpa-download-dialog__body p {
  margin: 0;
}

.rpa-download-dialog__ok {
  color: #0f766e;
  font-weight: 900;
}

.rpa-download-dialog__warn {
  color: #be123c;
  font-weight: 900;
}

.rpa-download-dialog__note {
  color: var(--muted);
  font-size: 14px;
}

.rpa-license-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(20,184,166,0.18);
  border-radius: 18px;
  background: rgba(240,253,250,0.9);
}

.rpa-license-box span {
  color: #064e3b;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 14px;
  font-weight: 900;
  word-break: break-all;
}

.rpa-license-box button {
  min-height: 36px;
  border: 0;
  border-radius: 999px;
  padding: 0 14px;
  color: #fff;
  background: linear-gradient(135deg, #14b8a6, #06b6d4);
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.rpa-download-dialog__actions {
  justify-content: flex-end;
  margin-top: 18px;
}

.card {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: 0 16px 40px rgba(17, 24, 39, 0.06);
}

.card h3 {
  margin: 0 0 10px;
  font-size: 21px;
}

.card p {
  margin: 0;
  color: #4b5563;
}

.tool-action-card {
  width: 100%;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.tool-action-card:hover {
  transform: translateY(-2px);
  border-color: rgba(236, 72, 153, 0.28);
  box-shadow: 0 20px 48px rgba(17, 24, 39, 0.09);
}

.card .tag-row,
.tool-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.tag,
.tool-pill {
  padding: 7px 10px;
  border-radius: 999px;
  color: #6b21a8;
  background: rgba(168, 85, 247, 0.1);
  font-size: 12px;
  font-weight: 800;
}

.value-panel {
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  gap: 20px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 34px;
  background: linear-gradient(135deg, #fff, #fff7ed);
  box-shadow: var(--shadow);
}

.compare {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: #fff;
}

.compare-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
}

.compare-row > div {
  padding: 14px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}

.compare-row:last-child > div {
  border-bottom: 0;
}

.compare-head > div {
  font-weight: 900;
  background: #fff7ed;
}

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

.tool-card {
  min-height: 120px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #fff;
}

.tool-card strong {
  display: block;
  margin-bottom: 8px;
}

.tool-card span {
  color: var(--muted);
  font-size: 13px;
}

.ai-layout {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  gap: 22px;
  padding: 28px 0 44px;
}

.preview-ai-page .ai-layout {
  padding-top: 32px;
}

.side-panel,
.chat-panel {
  border: 1px solid var(--line);
  border-radius: 30px;
  background: rgba(255,255,255,0.9);
  box-shadow: var(--shadow);
}

.side-panel {
  padding: 18px;
  align-self: start;
}

.mode-card {
  display: grid;
  place-items: center;
  width: 100%;
  margin-bottom: 10px;
  min-height: 76px;
  padding: 18px;
  border: 1px solid transparent;
  border-radius: 18px;
  text-align: center;
  background: #fff;
  cursor: pointer;
}

.mode-card.active {
  border-color: rgba(236, 72, 153, 0.35);
  background: #fff1f7;
}

.mode-card strong,
.mode-card span {
  display: block;
}

.mode-card strong {
  font-size: clamp(24px, 2.4vw, 34px);
  line-height: 1;
  letter-spacing: -0.04em;
}

.mode-card span {
  color: var(--muted);
  font-size: 13px;
}

.chat-panel {
  overflow: hidden;
}

.chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(135deg, #fff7ed, #fff1f7);
}

.chat-head h1 {
  margin: 0;
  font-size: 23px;
}

.chat-head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.chat-clear-btn {
  min-width: 82px;
  padding: 10px 18px;
  border: 0;
  border-radius: 999px;
  color: #0f766e;
  background: linear-gradient(135deg, rgba(45, 212, 191, 0.95), rgba(103, 232, 249, 0.86));
  box-shadow: 0 14px 32px rgba(20, 184, 166, 0.22);
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.chat-context-btn {
  min-width: 112px;
  color: #be185d;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(255, 241, 247, 0.9));
  box-shadow: 0 12px 28px rgba(190, 24, 93, 0.12);
  border: 1px solid rgba(244, 114, 182, 0.22);
}

.chat-clear-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 38px rgba(20, 184, 166, 0.28);
}

.chat-context-btn:hover {
  box-shadow: 0 16px 34px rgba(190, 24, 93, 0.18);
}

.temp-mail-workbench {
  max-width: 1180px;
  margin: 0 auto;
}

.temp-mail-status {
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(244, 114, 182, 0.16);
  border-radius: 18px;
  color: #9f1239;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.86), rgba(255, 241, 247, 0.72));
  font-size: 13px;
  font-weight: 800;
}

.temp-mail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.temp-mail-card {
  padding: 20px;
  border: 1px solid rgba(244, 114, 182, 0.16);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: 0 24px 60px rgba(244, 114, 182, 0.12);
}

.temp-mail-card--primary {
  grid-row: span 2;
}

.temp-mail-card-head {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
}

.temp-mail-card-head strong {
  font-size: 18px;
  color: var(--ink);
}

.temp-mail-card-head span,
.temp-mail-note,
.temp-mail-check,
.temp-mail-card .muted {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.temp-mail-form {
  grid-template-columns: minmax(0, 1.3fr) minmax(180px, 0.7fr);
}

.temp-mail-actions {
  margin-top: 12px;
}

.temp-mail-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  font-weight: 800;
}

.temp-mail-note {
  margin: 12px 0 0;
}

.temp-mail-list,
.temp-mail-detail,
.temp-mail-otp {
  margin-top: 12px;
}

.temp-mail-list {
  overflow-x: auto;
  border-radius: 16px;
}

.temp-mail-list table {
  min-width: 520px;
}

.temp-mail-detail pre,
.temp-mail-card pre {
  border: 1px solid rgba(244, 114, 182, 0.14);
  background: rgba(255, 247, 250, 0.72) !important;
}

.temp-mail-frame {
  width: 100%;
  min-height: 460px;
  margin-top: 12px;
  border: 1px solid rgba(244, 114, 182, 0.16);
  border-radius: 18px;
  background: #fff;
}

.temp-mail-field-gap {
  margin-top: 16px;
}

.temp-mail-links {
  margin-top: 18px;
}

.temp-mail-link-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.temp-mail-link-grid a {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid rgba(244, 114, 182, 0.14);
  border-radius: 16px;
  color: inherit;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.76);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.temp-mail-link-grid a:hover {
  transform: translateY(-1px);
  border-color: rgba(236, 72, 153, 0.28);
  box-shadow: 0 14px 30px rgba(236, 72, 153, 0.12);
}

.temp-mail-link-grid strong {
  color: #be185d;
  font-size: 14px;
}

.temp-mail-link-grid span {
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 920px) {
  .temp-mail-grid,
  .temp-mail-link-grid {
    grid-template-columns: 1fr;
  }

  .temp-mail-card--primary {
    grid-row: auto;
  }

  .temp-mail-form {
    grid-template-columns: 1fr;
  }
}

.chat-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.chat-window {
  min-height: 520px;
  padding: 24px;
  background: linear-gradient(180deg, #fff, #fffbf7);
}

.chat-window[hidden] {
  display: none !important;
}

.message {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
}

.message-body {
  display: grid;
  gap: 7px;
  max-width: min(760px, 82%);
}

.message.user {
  justify-content: flex-end;
}

.message.user .message-body {
  justify-items: end;
}

.avatar {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, #14b8a6, #16a34a);
  font-weight: 900;
}

.message.user .avatar {
  order: 2;
  background: linear-gradient(135deg, #ec4899, #f97316);
}

.message .bubble {
  margin: 0;
  max-width: 100%;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.86;
}

.message-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  opacity: .74;
  transform: translateY(-2px);
  transition: opacity .16s ease, transform .16s ease;
}

.message:hover .message-tools,
.message:focus-within .message-tools {
  opacity: 1;
  transform: translateY(0);
}

.message-tool {
  border: 1px solid rgba(225, 29, 138, 0.14);
  border-radius: 999px;
  padding: 4px 9px;
  color: #9d174d;
  background: rgba(255,255,255,0.86);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(17,24,39,0.05);
}

.message-tool:hover {
  border-color: rgba(225, 29, 138, 0.32);
  background: #fff1f7;
}

.message-edit-dialog[hidden] {
  display: none !important;
}

html.message-edit-open,
body.message-edit-open {
  overflow: hidden !important;
  overscroll-behavior: none;
}

.message-edit-dialog {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow: hidden;
  overscroll-behavior: none;
}

.message-edit-dialog__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(24, 18, 22, 0.36);
  backdrop-filter: blur(4px);
  touch-action: none;
}

.message-edit-dialog__panel {
  position: relative;
  z-index: 1;
  width: min(620px, calc(100vw - 32px));
  border: 1px solid rgba(225, 29, 138, 0.16);
  border-radius: 28px;
  padding: 20px;
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(255,247,250,0.96));
  box-shadow: 0 28px 90px rgba(88, 28, 55, 0.28);
  overscroll-behavior: contain;
  contain: layout paint;
}

.message-edit-dialog__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  color: var(--ink);
  font-size: 18px;
}

.message-edit-dialog__x {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  color: #9d174d;
  background: #fff1f7;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.message-edit-dialog textarea {
  width: 100%;
  min-height: 190px;
  max-height: 44vh;
  resize: vertical;
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
  border: 1px solid rgba(225, 29, 138, 0.18);
  border-radius: 20px;
  padding: 14px 16px;
  color: var(--ink);
  background: rgba(255,255,255,0.92);
  font: inherit;
  line-height: 1.75;
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.92);
}

.message-edit-dialog textarea:focus {
  border-color: rgba(225, 29, 138, 0.42);
  box-shadow: 0 0 0 4px rgba(225, 29, 138, 0.1);
}

.message-edit-dialog__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
}

.message-edit-dialog__btn {
  min-width: 88px;
  border: 1px solid rgba(225, 29, 138, 0.16);
  border-radius: 999px;
  padding: 10px 18px;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
  transition: transform .1s ease, box-shadow .1s ease;
}

.message-edit-dialog__btn:active,
.message-edit-dialog__x:active {
  transform: translateY(2px) scale(0.98);
}

.message-edit-dialog__btn.soft {
  color: #9d174d;
  background: #fff;
}

.message-edit-dialog__btn.primary {
  border-color: rgba(20, 184, 166, 0.35);
  color: #fff;
  background: linear-gradient(135deg, #14b8a6, #22d3ee);
  box-shadow: 0 12px 26px rgba(20, 184, 166, 0.2);
}

.message.user .bubble {
  border-top-right-radius: 6px;
  color: #fff;
  background: linear-gradient(135deg, #ec4899, #f97316);
}

.preview-ai-page .message .bubble {
  padding: 18px 20px;
  font-size: 15px;
  letter-spacing: 0.01em;
}

.preview-ai-page .message.ai .bubble {
  color: #172033;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 252, 248, 0.94)),
    radial-gradient(circle at 100% 0%, rgba(20, 184, 166, 0.08), transparent 34%);
}

.preview-ai-page .message.user .bubble {
  line-height: 1.78;
}

.composer {
  padding: 16px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.composer textarea {
  width: 100%;
  min-height: 104px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 14px;
  font: inherit;
  outline: none;
}

.composer textarea:focus {
  border-color: rgba(236, 72, 153, 0.45);
  box-shadow: 0 0 0 4px rgba(236, 72, 153, 0.1);
}

.preview-ai-page .ai-layout {
  min-height: calc(100vh - 70px);
  align-items: start;
}

.preview-ai-page .chat-panel {
  height: calc(100vh - 118px);
  min-height: 720px;
  max-height: 920px;
  display: flex;
  flex-direction: column;
}

.preview-ai-page .chat-head {
  flex: 0 0 auto;
}

.preview-ai-page .chat-window {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.preview-ai-page .composer {
  flex: 0 0 auto;
}

.composer-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.composer-tools[hidden],
.composer-image-preview[hidden] {
  display: none !important;
}

.composer-image-btn {
  border: 1px solid rgba(236, 72, 153, 0.18);
  border-radius: 999px;
  padding: 8px 14px;
  color: #be185d;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(255, 241, 247, 0.9));
  box-shadow: 0 12px 24px rgba(236, 72, 153, 0.1);
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.composer-image-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 30px rgba(236, 72, 153, 0.16);
}

.composer-image-preview {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.composer-image-item {
  position: relative;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  max-width: 240px;
  padding: 7px 32px 7px 7px;
  border: 1px solid rgba(236, 72, 153, 0.16);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 12px 26px rgba(17, 24, 39, 0.08);
}

.composer-image-item img {
  width: 56px;
  height: 48px;
  object-fit: cover;
  border-radius: 12px;
}

.composer-image-item span {
  overflow: hidden;
  color: #4b5563;
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.composer-image-item button {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 999px;
  color: #be185d;
  background: rgba(244, 114, 182, 0.14);
  cursor: pointer;
  font-weight: 900;
}

.message-image-strip {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.message.user .message-image-strip {
  justify-content: flex-end;
}

.message-image-thumb {
  display: grid;
  gap: 5px;
  width: 118px;
  padding: 7px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 16px;
  color: #fff;
  background: rgba(225, 29, 138, 0.18);
  cursor: zoom-in;
}

.message-image-thumb img {
  width: 100%;
  height: 86px;
  object-fit: cover;
  border-radius: 12px;
}

.message-image-thumb span {
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-image-preview-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 28px;
  background: rgba(15, 23, 42, 0.76);
  backdrop-filter: blur(14px);
}

.chat-image-preview-modal[hidden] {
  display: none;
}

.chat-image-preview-modal img {
  max-width: min(1120px, 94vw);
  max-height: 88vh;
  object-fit: contain;
  border-radius: 24px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.34);
}

.chat-image-preview-close {
  position: fixed;
  top: 22px;
  right: 24px;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 999px;
  color: #111827;
  background: #fff;
  cursor: pointer;
  font-size: 24px;
  font-weight: 900;
}

.preview-ai-page .composer textarea {
  min-height: 104px;
  max-height: 140px;
  resize: none;
}

.form-card {
  display: grid;
  gap: 12px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: #fff;
  box-shadow: var(--shadow);
}

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

.form-card input,
.form-card textarea,
.form-card select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 14px;
  color: var(--ink);
  background: #fff;
  font: inherit;
  outline: none;
}

.form-card textarea {
  min-height: 132px;
  resize: vertical;
}

.result-box {
  margin-top: 14px;
  padding: 16px;
  border-radius: 20px;
  background: #f8fafc;
  color: #334155;
  border: 1px solid var(--line);
}

.process-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.process-list li {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 12px;
  align-items: start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255,255,255,0.78);
}

.process-list b {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
}

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

.price-grid--single {
  width: min(720px, 100%);
  margin: 0 auto;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.price-card {
  position: relative;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 16px 40px rgba(17, 24, 39, 0.06);
}

.price-card.is-featured {
  border-color: rgba(236, 72, 153, 0.32);
  background: linear-gradient(180deg, #fff, #fff1f7);
}

.price-card h3 {
  margin: 0 0 6px;
}

.member-benefits {
  display: grid;
  gap: 8px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
  color: #4b5563;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.55;
}

.member-benefits li {
  position: relative;
  padding-left: 18px;
}

.member-benefits li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  color: #10b981;
  font-weight: 900;
}

.member-month-card {
  display: grid;
  gap: 12px;
}

.member-month-picker {
  display: grid;
  gap: 6px;
  color: #4b5563;
  font-size: 13px;
  font-weight: 800;
}

.member-month-picker input {
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid rgba(17, 24, 39, 0.1);
  border-radius: 16px;
  background: rgba(255,255,255,0.86);
  font: inherit;
  font-weight: 900;
  outline: none;
}

.member-month-picker input:focus {
  border-color: rgba(236,72,153,0.38);
  box-shadow: 0 0 0 4px rgba(236,72,153,0.1);
}

.member-total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 20px;
  background: rgba(255,255,255,0.76);
  border: 1px solid rgba(17,24,39,0.08);
}

.member-total span {
  color: var(--muted);
  font-weight: 800;
}

.member-total strong {
  font-size: 28px;
  line-height: 1;
}

.price {
  margin: 10px 0;
  font-size: 36px;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.price span {
  font-size: 15px;
  color: var(--muted);
}

.check-list {
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
  color: #4b5563;
  font-size: 14px;
}

.check-list li {
  margin: 7px 0;
}

.check-list li::before {
  content: "✓";
  margin-right: 7px;
  color: var(--green);
  font-weight: 900;
}

.translate-shell {
  display: grid;
  grid-template-columns: 1fr 1fr;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.82);
  border-radius: 38px;
  background: rgba(255,255,255,0.88);
  box-shadow: var(--shadow);
}

.translate-pane {
  min-height: 520px;
  display: flex;
  flex-direction: column;
  background: rgba(255,255,255,0.72);
}

.translate-pane + .translate-pane {
  border-left: 1px solid var(--line);
}

.translate-pane__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 72px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(135deg, rgba(255,247,237,0.86), rgba(255,241,247,0.72));
}

.translate-lang {
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 18px;
  font-weight: 900;
  outline: none;
}

.translate-pane textarea,
.translate-output {
  flex: 1;
  width: 100%;
  border: 0;
  padding: 28px;
  color: var(--ink);
  background: transparent;
  font: inherit;
  font-size: 20px;
  line-height: 1.75;
  outline: none;
  resize: none;
}

.translate-output {
  color: #233044;
  white-space: pre-wrap;
}

.translate-pane__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 22px;
  border-top: 1px solid var(--line);
}

.translate-tone-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.translate-tone {
  border: 1px solid rgba(225, 29, 138, 0.16);
  border-radius: 999px;
  padding: 7px 11px;
  color: #9d174d;
  background: linear-gradient(135deg, rgba(225, 29, 138, 0.09), rgba(255, 106, 26, 0.07));
  font: inherit;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.translate-toolbar {
  display: flex;
  justify-content: center;
  margin: -18px 0 20px;
}

.swap-btn {
  width: 54px;
  height: 54px;
  border: 1px solid rgba(255,255,255,0.8);
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 18px 42px rgba(225, 29, 138, 0.2);
  font-size: 22px;
  cursor: pointer;
}

.translate-workbench {
  width: 100%;
  max-width: 100%;
  display: block;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.82);
  border-radius: 34px;
  background:
    linear-gradient(180deg, rgba(245, 236, 255, 0.78), rgba(255, 255, 255, 0.9)),
    radial-gradient(circle at 82% 0%, rgba(225, 29, 138, 0.12), transparent 30%);
  box-shadow: var(--shadow);
}

.translate-topbar {
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px 22px;
  border-bottom: 1px solid rgba(17, 24, 39, 0.08);
  background: rgba(237, 226, 255, 0.55);
}

.translate-select-pill {
  min-width: 180px;
  border: 1px solid rgba(17, 24, 39, 0.08);
  border-radius: 14px;
  padding: 10px 14px;
  color: var(--ink);
  background: rgba(255, 250, 236, 0.9);
  font: inherit;
  font-weight: 900;
  outline: none;
  box-shadow: 0 8px 22px rgba(17, 24, 39, 0.06);
}

.translate-swap-inline {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(17, 24, 39, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  font-size: 20px;
  cursor: pointer;
}

.translate-dual-stack {
  display: grid;
  gap: 0;
}

.translate-dual-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 330px;
  border-bottom: 1px solid rgba(17, 24, 39, 0.08);
}

.translate-dual-row:last-child {
  border-bottom: 0;
}

.translate-cell {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 330px;
  background: rgba(255, 255, 255, 0.68);
}

.translate-cell + .translate-cell {
  border-left: 1px solid rgba(17, 24, 39, 0.08);
  background: rgba(241, 232, 255, 0.45);
}

.translate-cell-head {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 18px;
  color: #445066;
  font-size: 14px;
  font-weight: 900;
}

.translate-cell textarea,
.translate-cell-output {
  flex: 1;
  width: 100%;
  border: 0;
  padding: 18px 22px 76px;
  color: var(--ink);
  background: transparent;
  font: inherit;
  font-size: 18px;
  line-height: 1.8;
  outline: none;
  resize: none;
}

.translate-cell-output {
  color: #273247;
  white-space: pre-wrap;
}

.translate-cell-tools {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px;
  border: 1px solid rgba(17, 24, 39, 0.08);
  border-radius: 999px;
  background: rgba(255, 250, 236, 0.92);
  box-shadow: 0 14px 34px rgba(17, 24, 39, 0.12);
}

.translate-mini-btn {
  min-height: 34px;
  border: 0;
  border-radius: 999px;
  padding: 0 12px;
  background: rgba(255,255,255,0.78);
  color: #6b4b16;
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.translate-mini-btn.is-primary {
  color: #fff;
  background: #1f2937;
}

.translate-copy-btn {
  position: absolute;
  right: 18px;
  bottom: 18px;
  min-height: 38px;
  border: 1px solid rgba(17, 24, 39, 0.08);
  border-radius: 999px;
  padding: 0 14px;
  background: rgba(255, 250, 236, 0.95);
  color: #6b4b16;
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 14px 34px rgba(17, 24, 39, 0.12);
}

.translate-hint {
  color: #9aa3b2;
  font-size: 13px;
  font-weight: 700;
}

.translate-popover {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 30;
  width: min(420px, calc(100vw - 28px));
  max-height: min(560px, calc(100vh - 80px));
  overflow: hidden;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(17, 24, 39, 0.1);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 28px 90px rgba(17, 24, 39, 0.22);
  backdrop-filter: blur(20px);
}

.translate-popover__head {
  display: flex;
  gap: 8px;
  padding: 10px;
  border-bottom: 1px solid var(--line);
}

.translate-popover__head input,
.translate-phrase-add textarea {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 12px;
  font: inherit;
  outline: none;
}

.translate-popover__head button {
  width: 36px;
  border: 0;
  border-radius: 12px;
  background: #f8fafc;
  cursor: pointer;
}

.translate-emoji-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 6px;
  max-height: 360px;
  overflow: auto;
  padding: 12px;
}

.translate-emoji-grid button {
  min-height: 36px;
  border: 0;
  border-radius: 10px;
  background: #fff7ed;
  font-size: 20px;
  cursor: pointer;
}

.translate-phrase-list {
  display: grid;
  gap: 8px;
  max-height: 300px;
  overflow: auto;
  padding: 12px;
}

.translate-phrase-list button {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 12px;
  background: #fffaf4;
  text-align: left;
  white-space: pre-line;
  cursor: pointer;
}

.translate-phrase-add {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid var(--line);
}

.translate-phrase-add textarea {
  min-height: 58px;
  resize: vertical;
}

.translate-popover__foot {
  margin: 0;
  padding: 0 12px 12px;
  color: var(--muted);
  font-size: 12px;
}

.full-feature-frame {
  position: relative;
  overflow: hidden;
  height: min(760px, calc(100vh - 190px));
  min-height: 610px;
  padding: clamp(10px, 1.6vw, 18px);
  border: 1px solid rgba(255,255,255,0.86);
  border-radius: 42px;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.78), rgba(255,244,250,0.56)),
    radial-gradient(circle at 88% 6%, rgba(225, 29, 138, 0.13), transparent 34%),
    radial-gradient(circle at 12% 100%, rgba(255, 106, 26, 0.11), transparent 30%);
  box-shadow: 0 36px 100px rgba(76, 48, 30, 0.16);
  backdrop-filter: blur(18px);
}

.full-feature-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 30px;
  display: block;
  background: transparent;
  opacity: 0;
  transition: opacity 0.18s ease;
}

.preview-translate-page .preview-nav__inner {
  min-height: 78px;
}

.preview-translate-page .full-feature-frame {
  height: calc(100vh - 58px);
  min-height: 0;
  max-height: none;
  padding: 4px;
  border-radius: 26px;
}

.preview-translate-page .full-feature-frame iframe {
  border-radius: 20px;
}

.full-feature-frame.is-ready iframe {
  opacity: 1;
}

.frame-loading {
  position: absolute;
  inset: clamp(10px, 1.6vw, 18px);
  z-index: 2;
  display: grid;
  place-items: center;
  border-radius: 30px;
  color: #9d174d;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.9), rgba(255,244,250,0.82)),
    radial-gradient(circle at 88% 8%, rgba(225, 29, 138, 0.12), transparent 34%);
  font-weight: 900;
}

.frame-loading[hidden] {
  display: none;
}

.footer {
  padding: 34px 0 54px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

@media (max-width: 900px) {
  .preview-nav__inner {
    grid-template-columns: 180px minmax(0, 1fr) 110px;
    gap: 12px;
  }

  .brand {
    width: 180px;
  }

  .nav-links {
    gap: 4px;
  }

  .nav-links a {
    padding: 8px 9px;
  }

  .hero-grid,
  .value-panel,
  .ai-layout,
  .translate-shell,
  .tool-hero-grid,
  .tool-form-grid {
    grid-template-columns: 1fr;
  }

  .translate-pane + .translate-pane {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .translate-dual-row {
    grid-template-columns: 1fr;
  }

  .translate-cell + .translate-cell {
    border-left: 0;
    border-top: 1px solid rgba(17, 24, 39, 0.08);
  }

  .card-grid,
  .tool-board,
  .price-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .utility-menu__panel {
    width: min(420px, calc(100vw - 32px));
  }
}

@media (max-width: 640px) {
  .second-tier-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .preview-nav__inner,
  .section-head {
    display: flex;
    align-items: flex-start;
    flex-direction: column;
  }

  .brand {
    width: auto;
  }

  .nav-links {
    justify-content: flex-start;
  }

  .card-grid,
  .tool-board,
  .metric-row,
  .price-grid,
  .price-grid--single {
    grid-template-columns: 1fr;
  }

  .compare-row {
    grid-template-columns: 1fr;
  }

  .utility-menu {
    width: 100%;
  }

  .utility-menu summary {
    width: 100%;
  }

  .utility-menu__panel {
    left: 0;
    right: auto;
    grid-template-columns: 1fr;
  }

  .tool-result-grid,
  .tool-list-item,
  .rpa-download-panel {
    grid-template-columns: 1fr;
  }

  .translate-pane {
    min-height: 380px;
  }

  .translate-pane textarea,
  .translate-output {
    font-size: 17px;
    padding: 20px;
  }

  .translate-topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .translate-select-pill {
    width: 100%;
  }
}

/* Premium visual pass */
:root {
  --bg: #fff8f0;
  --paper: rgba(255, 255, 255, 0.78);
  --paper-strong: rgba(255, 255, 255, 0.94);
  --ink: #111827;
  --muted: #64748b;
  --line: rgba(17, 24, 39, 0.09);
  --brand: #e11d8a;
  --brand-2: #ff6a1a;
  --gold: #f8c77e;
  --shadow: 0 34px 90px rgba(72, 45, 26, 0.14);
  --shadow-soft: 0 18px 54px rgba(17, 24, 39, 0.08);
  --radius: 32px;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 18% 10%, rgba(225, 29, 138, 0.18), transparent 32%),
    radial-gradient(circle at 82% 4%, rgba(255, 106, 26, 0.17), transparent 34%),
    radial-gradient(circle at 50% 48%, rgba(248, 199, 126, 0.14), transparent 42%),
    linear-gradient(180deg, #fff8f2 0%, #fffaf5 42%, #fff 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(17, 24, 39, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(17, 24, 39, 0.025) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,0.55), transparent 72%);
}

.preview-shell {
  width: min(1240px, calc(100% - 40px));
}

.preview-nav {
  background: rgba(255, 248, 242, 0.72);
  border-bottom: 1px solid rgba(255, 255, 255, 0.75);
  box-shadow: 0 14px 42px rgba(90, 59, 36, 0.06);
}

.preview-nav__inner {
  min-height: 78px;
}

.brand {
  font-size: 16px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 17px;
  box-shadow: 0 16px 34px rgba(225, 29, 138, 0.3), inset 0 1px 0 rgba(255,255,255,0.35);
}

.nav-links {
  gap: 6px;
  font-weight: 800;
}

.nav-links a {
  padding: 9px 14px;
  transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.nav-links a:hover {
  transform: translateY(-1px);
}

.nav-links .is-active {
  background: linear-gradient(135deg, rgba(225, 29, 138, 0.13), rgba(255, 106, 26, 0.11));
}

.hero {
  position: relative;
  padding: 92px 0 76px;
}

.hero::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 16px;
  width: min(860px, 80vw);
  height: 1px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, transparent, rgba(225, 29, 138, 0.24), rgba(255, 106, 26, 0.22), transparent);
}

.hero-grid {
  grid-template-columns: minmax(0, 1.08fr) minmax(430px, 0.92fr);
  gap: clamp(34px, 6vw, 72px);
}

.eyebrow {
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.66);
  border: 1px solid rgba(225, 29, 138, 0.14);
  box-shadow: 0 10px 28px rgba(225, 29, 138, 0.07);
  color: #b91c67;
  letter-spacing: 0.08em;
}

.hero h1 {
  max-width: 850px;
  margin: 22px 0 22px;
  font-size: clamp(48px, 7vw, 92px);
  line-height: 0.96;
}

.hero--compact {
  padding: 54px 0 26px;
}

.hero--compact::after {
  bottom: 0;
}

.hero--compact h1 {
  max-width: 760px;
  margin: 16px 0 16px;
  font-size: clamp(38px, 5.2vw, 68px);
}

.hero--compact .lead {
  max-width: 720px;
  font-size: clamp(16px, 1.45vw, 19px);
}

.section--tight {
  padding-top: 18px;
}

.preview-translate-page .hero--compact {
  padding: 8px 0 0;
}

.preview-translate-page .hero--compact::after {
  display: none;
}

.preview-translate-page .hero--compact h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(20px, 2.35vw, 30px);
  line-height: 1;
}

.preview-translate-page .hero--compact .lead {
  display: none;
}

.preview-translate-page .hero--compact .eyebrow {
  display: none;
}

.preview-translate-page .section--tight {
  padding-top: 0;
  padding-bottom: 0;
}

.hero h1 span,
.section-title span {
  color: transparent;
  background: linear-gradient(105deg, var(--brand), var(--brand-2));
  -webkit-background-clip: text;
  background-clip: text;
}

.preview-home-page .hero h1 {
  max-width: 820px;
  font-size: clamp(48px, 5.45vw, 72px);
  line-height: 1.02;
}

.lead {
  max-width: 760px;
  color: #455166;
  font-size: clamp(18px, 1.8vw, 22px);
}

.hero-actions,
.section-actions,
.chat-actions {
  gap: 14px;
  margin-top: 30px;
}

.btn {
  min-height: 48px;
  padding: 0 21px;
  border-color: rgba(17, 24, 39, 0.08);
  background: rgba(255,255,255,0.86);
  box-shadow: 0 14px 34px rgba(17, 24, 39, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 44px rgba(17, 24, 39, 0.12);
}

.btn-primary,
.btn-green {
  box-shadow: 0 18px 42px rgba(225, 29, 138, 0.22);
}

.btn-primary:hover,
.btn-green:hover {
  filter: saturate(1.08) brightness(1.02);
}

.btn-primary {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
}

.btn-green,
.tg-support-btn {
  color: #fff;
  border-color: rgba(20, 184, 166, 0.32);
  background: linear-gradient(135deg, #14b8a6, #06b6d4);
  box-shadow: 0 18px 42px rgba(20, 184, 166, 0.22);
}

.tg-support-btn {
  font-weight: 900;
  letter-spacing: 0.01em;
}

.hero-card,
.side-panel,
.chat-panel,
.form-card,
.value-panel {
  border: 1px solid rgba(255,255,255,0.78);
  background:
    linear-gradient(135deg, rgba(255,255,255,0.92), rgba(255,255,255,0.68)),
    radial-gradient(circle at 0% 0%, rgba(225, 29, 138, 0.08), transparent 32%);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.hero-card {
  padding: 28px;
  border-radius: 40px;
}

.bubble {
  box-shadow: 0 18px 44px rgba(17, 24, 39, 0.1);
}

.bubble.user,
.message.user .bubble {
  background: linear-gradient(135deg, #e11d8a 0%, #ff6a1a 100%);
}

.metric {
  padding: 18px;
  border-color: rgba(255,255,255,0.78);
  background: rgba(255,255,255,0.72);
}

.metric strong {
  font-size: 22px;
}

.section {
  padding: 68px 0;
}

.section-head {
  margin-bottom: 28px;
}

.section-title {
  font-size: clamp(34px, 4.4vw, 58px);
  line-height: 1.04;
}

.section-sub {
  max-width: 850px;
  font-size: 17px;
}

.card,
.tool-card,
.price-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.8);
  background: rgba(255,255,255,0.78);
  box-shadow: var(--shadow-soft);
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.card::before,
.tool-card::before,
.price-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--brand), var(--brand-2), var(--gold));
  opacity: 0;
  transition: opacity 0.22s ease;
}

a.card:hover,
.tool-card:hover,
.price-card:hover {
  transform: translateY(-4px);
  border-color: rgba(225, 29, 138, 0.18);
  box-shadow: 0 28px 70px rgba(17, 24, 39, 0.12);
}

a.card:hover::before,
.tool-card:hover::before,
.price-card:hover::before {
  opacity: 1;
}

.card {
  min-height: 210px;
  padding: 28px;
}

.card h3,
.tool-card strong {
  font-size: 22px;
}

.tag,
.tool-pill {
  color: #9d174d;
  background: linear-gradient(135deg, rgba(225, 29, 138, 0.11), rgba(255, 106, 26, 0.09));
}

.value-panel {
  padding: clamp(26px, 4vw, 46px);
  border-radius: 42px;
}

.compare {
  border-color: rgba(255,255,255,0.8);
  box-shadow: var(--shadow-soft);
}

.compare-head > div {
  background: linear-gradient(135deg, #fff7ed, #fff1f7);
}

.tool-board {
  gap: 16px;
}

.tool-card {
  min-height: 146px;
  padding: 23px;
  border-radius: 26px;
}

.ai-layout {
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 28px;
  padding: 24px 0 72px;
}

.preview-ai-page .ai-layout {
  padding-top: 32px;
}

.side-panel {
  position: sticky;
  top: 104px;
  padding: 20px;
  border-radius: 34px;
}

.mode-card {
  min-height: 88px;
  padding: 20px;
  border-radius: 22px;
  box-shadow: 0 10px 24px rgba(17, 24, 39, 0.04);
}

.mode-card.active {
  border-color: rgba(225, 29, 138, 0.22);
  background: linear-gradient(135deg, #fff1f7, #fff7ed);
}

.chat-panel {
  border-radius: 36px;
}

.chat-head {
  padding: 24px 28px;
  background: linear-gradient(135deg, rgba(255,247,237,0.9), rgba(255,241,247,0.9));
}

.chat-window {
  min-height: 560px;
  padding: 30px;
}

.preview-ai-page .chat-window {
  min-height: 0;
}

.composer {
  padding: 20px;
}

.composer textarea,
.form-card input,
.form-card textarea,
.form-card select {
  border-color: rgba(17, 24, 39, 0.08);
  background: rgba(255,255,255,0.84);
}

.form-card {
  padding: 26px;
  border-radius: 34px;
}

.result-box {
  padding: 18px;
  border-color: rgba(17, 24, 39, 0.08);
  background: linear-gradient(135deg, #f8fafc, #fff7ed);
}

.result-box[data-mode="ok"] {
  border-color: rgba(20, 184, 166, 0.22);
  background: linear-gradient(135deg, #f0fdfa, #fff);
  color: #0f766e;
}

.result-box[data-mode="error"] {
  border-color: rgba(225, 29, 72, 0.2);
  background: linear-gradient(135deg, #fff1f2, #fff);
  color: #be123c;
}

#member-result-status {
  margin-top: 8px;
  line-height: 1.7;
}

.member-account-state {
  padding: 13px 15px;
  border: 1px solid rgba(17, 24, 39, 0.08);
  border-radius: 18px;
  background: rgba(255,255,255,0.82);
  color: var(--muted);
  font-weight: 800;
  line-height: 1.6;
}

.member-account-state[data-mode="ok"] {
  color: #0f766e;
  border-color: rgba(20, 184, 166, 0.2);
  background: rgba(240, 253, 250, 0.86);
}

.member-account-state[data-mode="error"] {
  color: #be123c;
  border-color: rgba(225, 29, 72, 0.18);
  background: rgba(255, 241, 242, 0.8);
}

.member-trial-state {
  padding: 13px 15px;
  border: 1px solid rgba(20, 184, 166, 0.18);
  border-radius: 18px;
  color: #0f766e;
  background: rgba(240,253,250,0.88);
  font-size: 13px;
  font-weight: 900;
  line-height: 1.7;
}

.member-trial-state[hidden] {
  display: none !important;
}

.member-trial-state strong {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 15px;
}

.member-trial-state[data-mode="member"] {
  color: #7c2d12;
  border-color: rgba(251, 146, 60, 0.24);
  background: rgba(255, 247, 237, 0.9);
}

.member-trial-state[data-mode="error"] {
  color: #be123c;
  border-color: rgba(225, 29, 72, 0.18);
  background: rgba(255, 241, 242, 0.84);
}

.member-redeem-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid rgba(124, 58, 237, 0.14);
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(250, 245, 255, 0.92), rgba(255, 255, 255, 0.88)),
    radial-gradient(circle at 100% 0%, rgba(124, 58, 237, 0.14), transparent 34%);
}

.member-redeem-card strong {
  display: block;
  color: #4c1d95;
  font-size: 15px;
  font-weight: 900;
}

.member-redeem-card span {
  display: block;
  margin-top: 3px;
  color: #6b7280;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.55;
}

.member-redeem-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.member-redeem-row input {
  min-height: 46px;
  border: 1px solid rgba(76, 29, 149, 0.12);
  border-radius: 16px;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  font: inherit;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  outline: none;
}

.member-redeem-row input:focus {
  border-color: rgba(124, 58, 237, 0.34);
  box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.1);
}

.member-redeem-row .btn {
  min-height: 46px;
  padding-inline: 18px;
}

.member-redeem-card p {
  min-height: 18px;
  margin: 0;
  color: #6b7280;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.5;
}

.member-redeem-card p[data-mode="ok"] {
  color: #0f766e;
}

.member-redeem-card p[data-mode="error"] {
  color: #be123c;
}

.member-payment-card {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  padding: 18px;
  border: 1px solid rgba(20, 184, 166, 0.18);
  border-radius: 26px;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.95), rgba(240,253,250,0.82)),
    radial-gradient(circle at 100% 0%, rgba(20,184,166,0.12), transparent 32%);
  box-shadow: 0 22px 55px rgba(15, 118, 110, 0.1);
}

.member-payment-card[hidden] {
  display: none !important;
}

.member-payment-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(255,255,255,0.72);
}

.member-payment-row span,
.member-pay-address,
.member-tx-box {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.member-payment-row strong {
  color: var(--ink);
  word-break: break-all;
}

.member-pay-address,
.member-tx-box {
  display: grid;
  gap: 8px;
}

.member-pay-address textarea {
  min-height: 78px;
  resize: none;
  word-break: break-all;
}

.member-payment-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.member-payment-actions .btn {
  flex: 1 1 150px;
}

.member-payment-note {
  border-radius: 16px;
  padding: 12px 14px;
  color: #0f766e;
  background: rgba(240,253,250,0.9);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.7;
}

.process-list {
  gap: 14px;
}

.process-list li {
  padding: 18px;
  border-color: rgba(255,255,255,0.78);
  background: rgba(255,255,255,0.74);
}

.price-grid {
  gap: 18px;
}

.price-card {
  padding: 28px;
  border-radius: 30px;
}

.price-card.is-featured {
  transform: translateY(-8px);
  border-color: rgba(225, 29, 138, 0.25);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.96), rgba(255,241,247,0.92)),
    radial-gradient(circle at 100% 0%, rgba(255,106,26,0.14), transparent 36%);
}

.price {
  font-size: 44px;
}

.check-list {
  font-size: 15px;
}

.cta-band {
  margin: 38px auto 0;
  padding: clamp(26px, 4vw, 44px);
  border: 1px solid rgba(255,255,255,0.8);
  border-radius: 42px;
  background:
    linear-gradient(135deg, rgba(17,24,39,0.94), rgba(77,35,74,0.92)),
    radial-gradient(circle at 85% 0%, rgba(255,106,26,0.28), transparent 34%);
  color: #fff;
  box-shadow: 0 34px 90px rgba(17, 24, 39, 0.22);
}

.cta-band .section-title,
.cta-band .section-sub {
  color: #fff;
}

.cta-band .section-sub {
  opacity: 0.82;
}

.cta-band .btn {
  background: rgba(255,255,255,0.12);
  color: #fff;
  border-color: rgba(255,255,255,0.18);
}

.cta-band .btn-primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
}

.footer {
  padding: 44px 0 68px;
}

.translate-workbench {
  padding: clamp(18px, 3vw, 30px);
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 34px;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.9), rgba(255,247,241,0.72)),
    radial-gradient(circle at 15% 0%, rgba(255,95,133,0.15), transparent 34%),
    radial-gradient(circle at 88% 12%, rgba(27,194,214,0.16), transparent 32%);
  box-shadow: 0 34px 92px rgba(143, 82, 74, 0.16);
}

.translate-workbench__bar,
.translate-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 16px;
}

.translate-workbench select {
  height: 42px;
  min-width: 150px;
  border: 1px solid rgba(219, 39, 119, 0.16);
  border-radius: 14px;
  background: rgba(255,255,255,0.86);
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  padding: 0 14px;
}

.translate-swap {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  font-size: 20px;
  font-weight: 900;
  cursor: pointer;
}

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

.translate-dual--reverse {
  margin-top: 16px;
}

.translate-pane {
  height: 360px;
  min-height: 360px;
  max-height: 360px;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(255, 255, 255, 0.88);
  border-radius: 24px;
  background: rgba(255,255,255,0.76);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.9), 0 18px 52px rgba(143,82,74,0.08);
  overflow: visible;
}

.translate-pane__head {
  flex: 0 0 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 46px;
  padding: 0 16px;
  border-bottom: 1px solid rgba(226, 173, 157, 0.32);
  color: var(--ink);
  font-weight: 900;
}

.translate-pane__head button {
  min-height: 30px;
  border: 1px solid rgba(225, 29, 138, 0.16);
  border-radius: 999px;
  padding: 5px 11px;
  background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(255,241,247,0.9));
  color: #c2186a;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(225, 29, 138, 0.08), inset 0 1px 0 rgba(255,255,255,0.92);
  transition: transform .1s ease, box-shadow .1s ease, background .16s ease, border-color .16s ease;
  user-select: none;
}

.translate-pane__head button:hover {
  border-color: rgba(225, 29, 138, 0.32);
  background: linear-gradient(180deg, #fff, #ffe8f2);
  box-shadow: 0 12px 24px rgba(225, 29, 138, 0.12), inset 0 1px 0 rgba(255,255,255,0.95);
}

.translate-pane__head button:active {
  transform: translateY(2px) scale(0.97);
  box-shadow: 0 3px 8px rgba(225, 29, 138, 0.12), inset 0 2px 5px rgba(157, 23, 77, 0.12);
}

.translate-pane__head button:disabled {
  cursor: wait;
  opacity: .62;
  transform: none;
}

.translate-pane__tools {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
}

.translate-pane__tools button {
  white-space: nowrap;
}

.translate-run-mini {
  border-color: rgba(20, 184, 166, 0.42) !important;
  color: #fff !important;
  background: linear-gradient(135deg, #14b8a6, #22d3ee) !important;
  box-shadow: 0 12px 24px rgba(20, 184, 166, 0.18), inset 0 1px 0 rgba(255,255,255,0.34) !important;
}

.translate-run-mini:hover {
  background: linear-gradient(135deg, #0fbaa7, #06b6d4) !important;
  box-shadow: 0 15px 30px rgba(20, 184, 166, 0.24), inset 0 1px 0 rgba(255,255,255,0.36) !important;
}

.translate-picker {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 20;
  width: min(320px, 70vw);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 12px;
  border: 1px solid rgba(219, 39, 119, 0.16);
  border-radius: 18px;
  background: rgba(255,255,255,0.98);
  box-shadow: 0 20px 55px rgba(143, 82, 74, 0.18);
}

.translate-picker--floating {
  position: fixed;
  right: auto;
  z-index: 9999;
}

.translate-picker button {
  min-height: 36px;
  padding: 8px 10px;
  border: 1px solid rgba(236,72,153,0.1);
  border-radius: 12px;
  background: linear-gradient(135deg, #fff7ed, #fff1f7);
  color: #33272a;
  font-size: 13px;
  font-weight: 800;
  text-align: left;
}

.translate-picker button:hover {
  border-color: rgba(236,72,153,0.28);
  background: #fff;
}

.translate-picker--emoji {
  width: min(680px, calc(100vw - 48px));
  max-height: 430px;
  display: block;
  overflow: auto;
  padding: 18px;
  border-radius: 26px;
  background:
    linear-gradient(145deg, rgba(255,255,255,0.98), rgba(255,247,250,0.96)),
    radial-gradient(circle at 100% 0%, rgba(236,72,153,0.16), transparent 38%);
  box-shadow: 0 30px 85px rgba(143, 82, 74, 0.22);
}

.translate-emoji-tabs {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 0 0 12px;
  margin-bottom: 10px;
  border-bottom: 1px solid rgba(219, 39, 119, 0.1);
  background: rgba(255,255,255,0.98);
}

.translate-emoji-tabs button {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 42px;
  min-height: 42px;
  padding: 0;
  border-radius: 999px;
  color: #7c2d5f;
  font-size: 23px;
  font-weight: 900;
  background: rgba(255,241,247,0.9);
}

.translate-emoji-tabs button.is-active {
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
}

.translate-emoji-body {
  max-height: none;
  overflow: visible;
  padding-right: 4px;
  scroll-behavior: smooth;
}

.translate-picker--emoji button {
  display: grid;
  place-items: center;
  width: 42px;
  min-height: 42px;
  padding: 0;
  font-size: 24px;
  line-height: 1;
  text-align: center;
}

.translate-emoji-section + .translate-emoji-section {
  margin-top: 16px;
}

.translate-emoji-title {
  margin-bottom: 8px;
  color: #7c2d5f;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.translate-emoji-grid {
  display: grid;
  grid-template-columns: repeat(12, 42px);
  gap: 8px;
  max-height: none;
  overflow: visible;
  padding: 0;
}

.translate-picker--phrase {
  width: min(680px, calc(100vw - 48px));
  max-height: 430px;
  display: block;
  overflow: auto;
  padding: 18px;
  border-radius: 26px;
  background:
    linear-gradient(145deg, rgba(255,255,255,0.98), rgba(255,247,250,0.96)),
    radial-gradient(circle at 100% 0%, rgba(20,184,166,0.13), transparent 38%);
  box-shadow: 0 30px 85px rgba(143, 82, 74, 0.22);
}

.translate-phrase-add {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 86px;
  gap: 10px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(219,39,119,0.1);
}

.translate-phrase-add textarea {
  min-height: 72px;
  max-height: 120px;
  resize: vertical;
  border: 1px solid rgba(236,72,153,0.16);
  border-radius: 16px;
  padding: 12px;
  background: rgba(255,255,255,0.9);
  color: #33272a;
  font: inherit;
  outline: none;
}

.translate-phrase-add button {
  display: grid;
  place-items: center;
  min-height: 72px;
  border-radius: 16px;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
}

.translate-phrase-section + .translate-phrase-section {
  margin-top: 16px;
}

.translate-phrase-title {
  margin-bottom: 8px;
  color: #7c2d5f;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.translate-phrase-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  max-height: none;
  overflow: visible;
  padding: 0;
}

.translate-phrase-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
  padding: 8px;
  border: 1px solid rgba(236,72,153,0.1);
  border-radius: 16px;
  background: rgba(255,255,255,0.68);
}

.translate-phrase-row:has(.translate-phrase-mini) {
  grid-template-columns: minmax(0, 1fr) 46px 46px;
}

.translate-phrase-insert {
  min-height: 54px;
  text-align: left;
}

.translate-phrase-mini {
  min-height: 54px;
  padding: 0;
  text-align: center;
  color: #7c2d5f;
}

.translate-phrase-empty {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.translate-pane textarea,
.translate-output {
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
  border: 0;
  outline: 0;
  resize: none;
  background: transparent;
  color: #33272a;
  font: inherit;
  font-size: 12.5px;
  line-height: 1.74;
  padding: 16px;
  overflow: auto;
}

.translate-output {
  white-space: pre-wrap;
}

.translate-actions {
  margin: 0;
  min-height: 0;
}

.translate-actions--reverse {
  margin-bottom: 0;
}

#translate-status {
  color: var(--muted);
  font-size: 14px;
}

#translate-status[data-mode="ok"] {
  color: #059669;
}

#translate-status[data-mode="error"] {
  color: #dc2626;
}

@media (max-width: 900px) {
  .hero {
    padding-top: 58px;
  }

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

  .side-panel {
    position: static;
  }

  .price-card.is-featured {
    transform: none;
  }

  .translate-dual {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .preview-shell {
    width: min(100% - 28px, 1240px);
  }

  .hero {
    padding: 44px 0 54px;
  }

  .hero h1 {
    font-size: clamp(40px, 13vw, 58px);
  }

  .section {
    padding: 48px 0;
  }

  .translate-workbench__bar,
  .translate-actions {
    flex-wrap: wrap;
  }

  .translate-workbench select {
    min-width: 128px;
  }
}

/* Final AI chat sizing override: keep the shell fixed and scroll only messages. */
.preview-ai-page .ai-layout {
  height: calc(100vh - 70px);
  min-height: 760px;
  overflow: hidden;
}

.preview-ai-page .chat-panel {
  height: calc(100vh - 118px);
  min-height: 720px;
  max-height: calc(100vh - 118px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.preview-ai-page .chat-head,
.preview-ai-page .composer {
  flex: 0 0 auto;
}

.preview-ai-page .chat-window {
  flex: 1 1 auto;
  height: auto;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  overflow-x: hidden;
}

.preview-ai-page .message .message-body {
  max-width: min(760px, 84%);
}

.preview-ai-page .message .bubble {
  max-width: 100%;
  line-height: 1.95;
}

.preview-ai-page .message.ai .message-body {
  max-width: min(720px, 84%);
}

.preview-ai-page .message.user .message-body {
  max-width: min(680px, 80%);
}

.preview-ai-page .message.ai .message-body {
  max-width: min(780px, 92%);
}

.preview-ai-page .message.ai .bubble.ai-rich {
  display: grid;
  gap: 14px;
  padding: 22px 24px;
  white-space: normal;
  font-size: 15px;
  line-height: 1.82;
  letter-spacing: 0;
}

.preview-ai-page .ai-rich p,
.preview-ai-page .ai-rich ul,
.preview-ai-page .ai-rich ol {
  margin: 0;
}

.preview-ai-page .ai-paragraph {
  color: #243044;
  overflow-wrap: anywhere;
}

.preview-ai-page .ai-heading {
  margin-top: 2px;
  color: #111827;
  font-size: 17px;
  font-weight: 950;
  line-height: 1.45;
}

.preview-ai-page .ai-script-heading {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 7px 12px;
  color: #9d174d;
  background: linear-gradient(135deg, rgba(255, 241, 247, 0.95), rgba(240, 253, 250, 0.9));
  box-shadow: inset 0 0 0 1px rgba(225, 29, 138, 0.11);
}

.preview-ai-page .ai-script-heading::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: linear-gradient(135deg, #e11d8a, #14b8a6);
}

.preview-ai-page .ai-callout,
.preview-ai-page .ai-quote-block {
  border: 1px solid rgba(225, 29, 138, 0.12);
  border-left: 4px solid rgba(225, 29, 138, 0.5);
  border-radius: 18px;
  padding: 14px 16px;
  background:
    linear-gradient(180deg, rgba(255, 241, 247, 0.72), rgba(255, 247, 237, 0.62)),
    rgba(255, 255, 255, 0.86);
  color: #3b1f35;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.9);
}

.preview-ai-page .ai-quote-block {
  border-color: rgba(20, 184, 166, 0.16);
  border-left-color: rgba(20, 184, 166, 0.58);
  background:
    linear-gradient(180deg, rgba(240, 253, 250, 0.7), rgba(255, 255, 255, 0.72)),
    rgba(255, 255, 255, 0.9);
  color: #164e63;
}

.preview-ai-page .ai-paragraph-group {
  display: grid;
  gap: 10px;
}

.preview-ai-page .ai-list {
  display: grid;
  gap: 9px;
  padding-left: 1.25em;
  color: #243044;
}

.preview-ai-page .ai-list li::marker {
  color: #e11d8a;
  font-weight: 900;
}

.preview-ai-page .ai-list-line {
  position: relative;
  padding-left: 18px;
  color: #243044;
}

.preview-ai-page .ai-list-line::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.78em;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(135deg, #e11d8a, #14b8a6);
}

.preview-ai-page .ai-paragraph:has(.ai-inline-quote) + .ai-paragraph,
.preview-ai-page .ai-paragraph-group .ai-paragraph:has(+ .ai-heading) {
  margin-bottom: 2px;
}

.preview-ai-page .ai-paragraph:first-letter {
  letter-spacing: 0;
}

.preview-ai-page .ai-inline-quote {
  color: #7c2d12;
  font-weight: 850;
}

.preview-ai-page .ai-thinking {
  color: #64748b;
  font-weight: 750;
}

/* Tutorial Center */
.preview-tutorial-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 18% 8%, rgba(236, 72, 153, 0.16), transparent 28%),
    radial-gradient(circle at 84% 0%, rgba(20, 184, 166, 0.16), transparent 30%),
    linear-gradient(180deg, #fff7fb 0%, #f5efff 46%, #ffffff 100%);
}

.tutorial-hero {
  padding: 44px 0 22px;
}

.tutorial-hero h1 {
  max-width: 840px;
  margin: 16px 0 12px;
  font-size: clamp(36px, 5vw, 62px);
  line-height: 1.04;
  letter-spacing: -0.055em;
}

.tutorial-hero p {
  max-width: 720px;
  margin: 0;
  color: #64748b;
  font-size: 16px;
  font-weight: 700;
}

.tutorial-hub-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 12px 0 46px;
  display: grid;
  grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.tutorial-article-shell {
  grid-template-columns: minmax(210px, 280px) minmax(0, 860px);
}

.tutorial-hub-sidebar,
.tutorial-article-list,
.tutorial-article {
  border: 1px solid rgba(255, 255, 255, 0.78);
  background:
    linear-gradient(155deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.76)),
    radial-gradient(circle at 100% 0%, rgba(236, 72, 153, 0.1), transparent 34%);
  box-shadow: 0 28px 70px rgba(88, 28, 135, 0.1);
  backdrop-filter: blur(18px);
}

.tutorial-hub-sidebar {
  position: sticky;
  top: 92px;
  max-height: calc(100vh - 112px);
  overflow: auto;
  border-radius: 28px;
  padding: 16px 0;
}

.tutorial-hub-cat-title {
  margin: 0 0 10px;
  padding: 0 18px;
  color: #4c1d95;
  font-size: 15px;
  font-weight: 950;
  letter-spacing: 0.03em;
}

.tutorial-cat-list,
.tutorial-article-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.tutorial-cat-list li a,
.tutorial-cat-list button {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 11px 18px;
  border: 0;
  color: #475569;
  background: transparent;
  font: inherit;
  font-size: 14px;
  font-weight: 850;
  text-align: left;
  cursor: pointer;
}

.tutorial-cat-list li a:hover,
.tutorial-cat-list button:hover,
.tutorial-cat-list button.active {
  color: #7c3aed;
  background: rgba(124, 58, 237, 0.08);
}

.tutorial-cat-list button.active {
  font-weight: 950;
}

.tutorial-cat-list .cnt {
  color: #94a3b8;
  font-size: 12px;
  font-weight: 850;
}

.tutorial-hub-main {
  min-width: 0;
}

.tutorial-article-list {
  border-radius: 32px;
  overflow: hidden;
}

.tutorial-article-list li {
  display: flex;
  gap: 14px;
  align-items: center;
  min-height: 82px;
  padding: 18px 22px;
  border-bottom: 1px solid rgba(124, 58, 237, 0.1);
  transition: background 0.18s ease, transform 0.18s ease;
}

.tutorial-article-list li:last-child {
  border-bottom: 0;
}

.tutorial-article-list li:hover {
  background: rgba(255, 255, 255, 0.62);
}

.tutorial-article-list li.hidden {
  display: none;
}

.tutorial-article-list .tut-thumb {
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
  border-radius: 18px;
  object-fit: cover;
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.12), rgba(20, 184, 166, 0.12));
}

.tutorial-article-list .tut-info {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.tutorial-article-list .tut-info a,
.tutorial-article-list .tut-title--guest {
  overflow: hidden;
  color: #111827;
  font-size: 16px;
  font-weight: 950;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tutorial-article-list .tut-info a:hover {
  color: #db2777;
}

.tutorial-article-list .meta {
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.tutorial-article-list .tutorial-list-hint {
  align-items: flex-start;
  color: #4c1d95;
  background: linear-gradient(135deg, rgba(250, 245, 255, 0.95), rgba(255, 255, 255, 0.78));
  font-size: 14px;
  font-weight: 850;
  line-height: 1.7;
}

.tutorial-article-list .tutorial-list-hint a {
  color: #db2777;
  font-weight: 950;
}

.tutorial-article {
  border-radius: 34px;
  padding: clamp(24px, 4vw, 44px);
  color: #1f2937;
  min-width: 0;
  overflow: hidden;
}

.tutorial-article img {
  max-width: 100%;
  height: auto;
  border-radius: 22px;
  vertical-align: middle;
}

.tutorial-article figure {
  margin: 1.2rem 0;
}

.tutorial-article figcaption {
  margin-top: 8px;
  color: #64748b;
  font-size: 12px;
  font-weight: 750;
}

.tutorial-article-header {
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(124, 58, 237, 0.12);
}

.tutorial-article-h1 {
  margin: 0 0 12px;
  color: #111827;
  font-size: clamp(30px, 4vw, 52px);
  line-height: 1.08;
  letter-spacing: -0.045em;
}

.tutorial-article-lead {
  margin: 0 0 12px;
  color: #64748b;
  font-size: 16px;
  font-weight: 750;
  line-height: 1.7;
}

.tutorial-article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: #7c3aed;
  font-size: 12px;
  font-weight: 900;
}

.tutorial-content h2,
.tutorial-article-h2 {
  margin: 34px 0 14px;
  padding-left: 14px;
  border-left: 4px solid #ec4899;
  color: #111827;
  font-size: 22px;
  line-height: 1.35;
}

.tutorial-content p,
.tutorial-p {
  max-width: 100%;
  color: #334155;
  font-size: 15px;
  line-height: 1.86;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.tutorial-content ul,
.tutorial-ul {
  padding-left: 1.2em;
  color: #334155;
  line-height: 1.8;
}

.tutorial-content blockquote,
.tutorial-blockquote,
.tutorial-read-locked {
  max-width: 100%;
  margin: 18px 0;
  padding: 18px 20px;
  border: 1px solid rgba(124, 58, 237, 0.12);
  border-left: 4px solid rgba(236, 72, 153, 0.74);
  border-radius: 22px;
  background: rgba(250, 245, 255, 0.75);
  color: #4c1d95;
  font-weight: 800;
  overflow: hidden;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.tutorial-content pre,
.tutorial-article pre {
  max-width: 100%;
  overflow-x: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  border: 1px solid rgba(124, 58, 237, 0.12);
  border-radius: 22px;
  padding: 16px 18px;
  background: rgba(250, 245, 255, 0.75);
  color: #4c1d95;
  font-size: 13px;
  line-height: 1.75;
}

.tutorial-content code {
  max-width: 100%;
  padding: 2px 6px;
  border-radius: 8px;
  background: rgba(124, 58, 237, 0.1);
  color: #5b21b6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-all;
}

.tutorial-content blockquote *,
.tutorial-blockquote *,
.tutorial-article pre *,
.tutorial-content pre * {
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.tutorial-content,
.tutorial-content *,
.tutorial-article,
.tutorial-article * {
  min-width: 0;
}

.tutorial-content > *,
.tutorial-content div,
.tutorial-content span,
.tutorial-content p,
.tutorial-content li,
.tutorial-content td,
.tutorial-content th {
  max-width: 100% !important;
  overflow-wrap: anywhere !important;
  word-break: break-word !important;
}

.tutorial-content pre,
.tutorial-content code,
.tutorial-content textarea,
.tutorial-content .code,
.tutorial-content [style*="white-space"],
.tutorial-content [style*="monospace"] {
  max-width: 100% !important;
  white-space: pre-wrap !important;
  overflow-x: auto !important;
  overflow-wrap: anywhere !important;
  word-break: break-all !important;
}

.tutorial-img-placeholder {
  min-height: 220px;
  display: grid;
  place-items: center;
  border: 1px dashed rgba(124, 58, 237, 0.28);
  border-radius: 24px;
  color: #7c3aed;
  background: rgba(250, 245, 255, 0.72);
  font-weight: 900;
}

.tutorial-faq dt {
  margin: 16px 0 6px;
  color: #111827;
  font-weight: 950;
}

.tutorial-faq dd {
  margin: 0 0 8px;
  color: #64748b;
  line-height: 1.75;
}

.tutorial-article-nav {
  margin-top: 34px;
  padding-top: 20px;
  border-top: 1px solid rgba(124, 58, 237, 0.12);
}

.tutorial-back-btn,
.tutorial-read-locked__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, #ec4899, #f97316);
  font-weight: 950;
  box-shadow: 0 16px 34px rgba(236, 72, 153, 0.22);
}

.tutorial-read-locked__title {
  margin: 0 0 6px;
  color: #111827;
  font-size: 18px;
  font-weight: 950;
}

.tutorial-read-locked__desc {
  margin: 0 0 12px;
  color: #64748b;
}

.tutorial-footer {
  text-align: center;
}

.tutorial-footer .links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 10px;
  font-weight: 850;
}

@media (max-width: 860px) {
  .tutorial-hub-shell,
  .tutorial-article-shell {
    grid-template-columns: 1fr;
  }

  .tutorial-hub-sidebar {
    position: static;
    max-height: none;
  }

  .tutorial-hero {
    padding-top: 28px;
  }

  .tutorial-article-list .tut-info a,
  .tutorial-article-list .tut-title--guest {
    white-space: normal;
  }
}
