:root {
  --bg-1: #2e1065;
  --bg-2: #4c1d95;
  --accent: #7c3aed;
  --accent-2: #a78bfa;
  --accent-deep: #5b21b6;
  --card: rgba(255, 255, 255, 0.94);
  --text: #27174a;
  --muted: #6e5ea1;
  --line: #e9e2ff;
  --surface: #f8f5ff;
  --surface-2: #f2ecff;
  --ok: #0b8f5a;
  --bad: #c63434;
  --shadow: 0 18px 48px rgba(43, 16, 101, 0.24);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  color: var(--text);
  background: radial-gradient(circle at 15% 10%, var(--accent-2) 0%, transparent 35%),
    radial-gradient(circle at 85% 20%, #c4b5fd 0%, transparent 30%),
    linear-gradient(125deg, var(--bg-1), var(--bg-2));
  font-family: "Space Grotesk", sans-serif;
}

.atmosphere {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 26px 26px;
  opacity: 0.2;
  z-index: 0;
}

.bg-shape {
  position: fixed;
  border-radius: 999px;
  filter: blur(62px);
  pointer-events: none;
  z-index: 0;
}

.bg-shape-a {
  width: 260px;
  height: 260px;
  background: rgba(124, 58, 237, 0.25);
  left: -80px;
  bottom: 28px;
}

.bg-shape-b {
  width: 280px;
  height: 280px;
  background: rgba(167, 139, 250, 0.24);
  right: -70px;
  top: 56px;
}

.container {
  position: relative;
  z-index: 1;
}

.container {
  width: min(1240px, calc(100% - 2rem));
  margin: 1rem auto 2rem;
  display: grid;
  gap: 1rem;
}

.panel {
  background: var(--card);
  border-radius: 18px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(124, 58, 237, 0.18);
  padding: 1rem 1.1rem;
  animation: rise 280ms ease-out;
}

@keyframes rise {
  from {
    transform: translateY(8px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.hero {
  background: var(--card);
  border-radius: 18px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(124, 58, 237, 0.18);
  padding: 1rem 1.1rem;
  animation: rise 280ms ease-out;
}

.hero h1 {
  margin: 0.15rem 0 0.35rem;
  font-size: clamp(1.8rem, 3vw, 2.4rem);
}

.eyebrow {
  margin: 0;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-weight: 700;
  font-size: 0.72rem;
}

.subtitle {
  margin: 0;
  color: #3e2d6d;
}

h2,
h3 {
  margin: 0;
}

.muted {
  color: var(--muted);
  margin: 0;
}

.compact {
  margin-top: 0.45rem;
}

code,
button,
input,
select,
textarea {
  font-family: "IBM Plex Mono", monospace;
}

.form {
  display: grid;
  gap: 10px;
}

.field-label,
label {
  display: block;
  margin-top: 0.5rem;
  margin-bottom: 0.35rem;
  font-size: 0.78rem;
  color: var(--muted);
}

input,
textarea,
select,
summary {
  width: 100%;
  border-radius: 10px;
  border: 1px solid #d7c9fb;
  background: var(--surface);
  color: #2a1652;
  padding: 0.62rem 0.66rem;
  font-size: 0.84rem;
}

input:focus-visible,
textarea:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 2px solid rgba(124, 58, 237, 0.3);
  outline-offset: 1px;
}

.auth-shell {
  width: min(560px, calc(100% - 2rem));
  margin: 2.2rem auto;
  position: relative;
  z-index: 1;
}

.auth-form {
  margin-top: 0.65rem;
}

.auth-card h1 {
  margin: 0.25rem 0 0.45rem;
  font-size: clamp(1.6rem, 3vw, 2rem);
}

.auth-actions,
.auth-actions-wrap {
  margin-top: 0.8rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
}

.auth-note {
  margin: 0.65rem 0 0;
  font-size: 0.76rem;
  line-height: 1.45;
  color: var(--muted);
}

.inline-link {
  margin-top: 0.75rem;
}

.inline-link a {
  color: var(--accent-deep);
  font-weight: 700;
}

.btn {
  border-radius: 10px;
  border: 1px solid #d7c9fb;
  padding: 0.6rem 0.75rem;
  cursor: pointer;
  font-size: 0.84rem;
  font-weight: 700;
  transition: transform 120ms ease, background 120ms ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent-deep);
}

.btn-primary:hover {
  background: var(--accent-deep);
}

.btn-secondary {
  background: #6d28d9;
  color: #fff;
  border-color: #5b21b6;
}

.btn-secondary:hover {
  background: #5b21b6;
}

.btn-tertiary {
  background: var(--surface);
  color: #4d2b8f;
  border-color: #d6c7fb;
}

.btn-tertiary:hover {
  background: var(--accent-deep);
  color: #fff;
}

.ghost,
.ghost-link {
  font-weight: 700;
}

a.ghost,
button.ghost.ghost-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border-radius: 10px;
  border: 1px solid #d6c7fb;
  font-size: 0.84rem;
  font-family: "IBM Plex Mono", monospace;
  padding: 0.6rem 0.75rem;
  background: var(--surface);
  color: #4d2b8f;
  transition: transform 120ms ease, background 120ms ease;
  min-height: 38px;
}

a.ghost:hover,
button.ghost.ghost-link:hover {
  transform: translateY(-1px);
  background: var(--accent-deep);
  border-color: var(--accent-deep);
  color: #fff;
}

.btn-danger {
  background: #dc2626;
  color: #fff;
  border-color: #b91c1c;
}

.btn-danger:hover {
  background: #b91c1c;
}

.btn.mini {
  padding: 0.42rem 0.66rem;
  font-size: 0.76rem;
}

.hero-button-row .btn,
.hero-button-row .ghost-link {
  min-height: 38px;
  padding: 0.6rem 0.75rem;
  font-size: 0.84rem;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.flash-list {
  display: grid;
  gap: 8px;
}

.flash {
  border-radius: 10px;
  padding: 10px 12px;
  font-weight: 600;
  border: 1px solid transparent;
  font-size: 0.84rem;
}

.flash-success {
  background: rgba(11, 143, 90, 0.14);
  border-color: rgba(11, 143, 90, 0.35);
  color: #0b6d46;
}

.flash-error {
  background: rgba(198, 52, 52, 0.14);
  border-color: rgba(198, 52, 52, 0.35);
  color: #8b1d1d;
}

.flash-info {
  background: rgba(124, 58, 237, 0.14);
  border-color: rgba(124, 58, 237, 0.35);
  color: #4d2b8f;
}

.flash a {
  color: #4c1d95;
  font-weight: 700;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.7rem;
  flex-wrap: wrap;
}

.panel-head {
  display: grid;
  gap: 0.45rem;
  margin-bottom: 1.05rem;
}

.hero-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.hero-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.45rem;
}

.hero-button-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.hero-button-row form {
  margin: 0;
}

.account-hero {
  padding: 1rem 1.1rem;
}

.account-section {
  display: grid;
  gap: 0.65rem;
}

.table-wrap {
  overflow: auto;
}

.account-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1120px;
}

.account-table th,
.account-table td {
  text-align: left;
  vertical-align: middle;
  padding: 0.6rem 0.55rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.8rem;
}

.account-table th {
  color: #4d2f87;
  font-size: 0.73rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.account-table tbody tr:hover {
  background: var(--surface-2);
}

.inline-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.inline-form input,
.inline-form select {
  width: auto;
  min-width: 140px;
}

.inline-form.inline-form-wide input[type="text"] {
  min-width: min(420px, 100%);
  flex: 1;
}

.account-table input[type="text"] {
  width: 100%;
}

.account-section .account-table td {
  vertical-align: middle;
}

.account-divider {
  border: 0;
  border-top: 1px solid rgba(124, 58, 237, 0.14);
  margin: 0.25rem 0 0.15rem;
}

.stack-actions {
  display: grid;
  gap: 0.45rem;
  justify-items: start;
}

.action-row {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.4rem;
}

.member-display-name-input {
  width: 100%;
  min-width: 220px;
}

.member-action-row input[type="password"] {
  min-width: 180px;
}

.member-action-row select {
  min-width: 120px;
}

.verified-select {
  min-width: 92px;
  max-width: 110px;
  font-size: 0.78rem;
  padding: 0.42rem 0.5rem;
}

.mini-check {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
}

.mini-check input {
  width: 14px;
  height: 14px;
  padding: 0;
  margin: 0;
}

.hidden {
  display: none !important;
}

.status-message {
  margin: 0;
}

.status-sent {
  color: #0b6d46;
}

.status-failed {
  color: #8b1d1d;
}

.table-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0.42rem 0.8rem;
  border: 1px solid rgba(124, 58, 237, 0.26);
  background: var(--surface);
  color: #4b1f97;
  cursor: pointer;
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 700;
}

.table-link:hover {
  background: var(--accent);
  border-color: var(--accent-deep);
  color: #fff;
}

.table-link-button {
  font-family: "IBM Plex Mono", monospace;
  line-height: 1.2;
}

.table-link-button:disabled {
  opacity: 0.65;
  cursor: wait;
}

.table-link-danger {
  border-color: rgba(180, 35, 24, 0.24);
  color: #b42318;
  background: #fff0ee;
}

.table-link-danger:hover {
  background: #b42318;
  border-color: #8f2219;
  color: #fff;
}

.selection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 14px;
}

.selection-card {
  background: rgba(248, 245, 255, 0.78);
  border: 1px solid rgba(124, 58, 237, 0.18);
  border-radius: 14px;
  padding: 16px;
}

.check-dropdown {
  border: 1px solid rgba(124, 58, 237, 0.22);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.95);
}

.check-dropdown summary {
  list-style: none;
  cursor: pointer;
  font-weight: 700;
}

.check-dropdown summary::-webkit-details-marker {
  display: none;
}

.dropdown-actions {
  display: flex;
  gap: 8px;
  padding: 0 10px 8px;
}

.check-list {
  max-height: 260px;
  overflow: auto;
  border-top: 1px solid rgba(124, 58, 237, 0.12);
  padding: 6px 8px;
  display: grid;
  gap: 0;
}

.check-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px;
  border-radius: 8px;
  cursor: pointer;
  margin: 0;
  line-height: 1.15;
}

.check-item:hover {
  background: rgba(124, 58, 237, 0.08);
}

.check-item input {
  width: 16px;
  height: 16px;
  padding: 0;
  margin: 0;
}

.check-item span {
  line-height: 1.15;
}

.checkbox-row {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.checkbox-row input {
  width: 18px;
  height: 18px;
  margin: 0;
  padding: 0;
}

.status-head,
.results-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.status-text {
  margin: 10px 0 0;
  font-size: 0.9rem;
  color: #3e2d6d;
}

.generator-panel,
.editor-launch-panel {
  padding: 1.45rem 1.4rem 1.75rem;
}

.editor-launch-panel .status-text,
.generator-panel .status-text {
  margin-top: 12px;
  margin-bottom: 0.75rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  min-height: 28px;
  padding: 0 12px;
  background: rgba(124, 58, 237, 0.15);
  color: #4d2b8f;
}

.badge-running {
  background: rgba(124, 58, 237, 0.2);
  color: #5b21b6;
}

.badge-done {
  background: rgba(11, 143, 90, 0.18);
  color: #0b6d46;
}

.badge-failed {
  background: rgba(198, 52, 52, 0.18);
  color: #8b1d1d;
}

.progress-wrap {
  margin-top: 10px;
}

.progress-track {
  width: 100%;
  height: 10px;
  background: rgba(124, 58, 237, 0.12);
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #7c3aed, #a78bfa);
  transition: width 220ms ease;
}

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

.stage-item {
  border: 1px solid rgba(124, 58, 237, 0.14);
  border-radius: 10px;
  background: rgba(248, 245, 255, 0.8);
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.stage-status {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.stage-pending .stage-status {
  color: #75838a;
}

.stage-running .stage-status {
  color: #5b21b6;
}

.stage-done .stage-status {
  color: #0b6d46;
}

.stage-failed .stage-status {
  color: #8b1d1d;
}

.job-log {
  margin: 12px 0 0;
  white-space: pre-wrap;
  background: rgba(33, 19, 61, 0.94);
  color: #efe9ff;
  border: 1px solid rgba(239, 233, 255, 0.18);
  border-radius: 10px;
  padding: 12px;
  max-height: 340px;
  overflow: auto;
  font-size: 0.78rem;
  line-height: 1.45;
}

.download-grid {
  margin-top: 12px;
  display: grid;
  gap: 10px;
}

.download-summary {
  margin-top: 12px;
  border: 1px solid rgba(124, 58, 237, 0.14);
  border-radius: 12px;
  background: rgba(248, 245, 255, 0.8);
  padding: 12px;
}

.download-summary.empty {
  border-style: dashed;
}

.download-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.download-summary-item {
  display: grid;
  gap: 4px;
}

.download-summary-label {
  font-size: 0.73rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6e5ea1;
}

.download-grid.empty,
.history-list.empty {
  border: 1px dashed rgba(124, 58, 237, 0.24);
  border-radius: 12px;
  padding: 12px;
}

.download-item,
.history-item {
  border: 1px solid rgba(124, 58, 237, 0.14);
  border-radius: 10px;
  background: rgba(248, 245, 255, 0.8);
  padding: 10px;
}

.download-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.download-meta {
  display: grid;
  gap: 4px;
}

.download-meta strong {
  font-size: 1.02rem;
}

.history-list {
  display: grid;
  gap: 8px;
}

.history-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.history-title {
  font-weight: 700;
}

.compact-form {
  margin-top: 12px;
}

.draft-shell {
  display: grid;
  gap: 1rem;
}

.draft-toolbar-panel {
  display: grid;
  gap: 14px;
}

.draft-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.draft-toolbar-copy {
  display: grid;
  gap: 6px;
}

.draft-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.draft-selection-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.draft-meta-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.draft-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.draft-editor-panel,
.draft-preview-panel {
  min-height: 82vh;
  display: grid;
  grid-template-rows: auto 1fr;
}

.draft-preview-panel {
  position: sticky;
  top: 1rem;
  align-self: start;
  height: calc(100vh - 2rem);
}

.panel-head-split {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.draft-editor-body {
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 0;
}

.draft-fields-view,
.draft-json-view {
  min-height: 0;
  overflow: auto;
}

.draft-fields-view {
  display: grid;
  gap: 12px;
  padding-top: 12px;
}

.draft-json-view {
  padding-top: 12px;
}

.draft-json-input {
  width: 100%;
  min-height: 60vh;
  resize: vertical;
  white-space: pre;
  font-size: 0.78rem;
  line-height: 1.5;
  background: rgba(33, 19, 61, 0.96);
  color: #f3efff;
  border-color: rgba(239, 233, 255, 0.16);
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 8, 35, 0.56);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 30;
}

.modal-card {
  width: min(460px, 100%);
  background: var(--card);
  border: 1px solid rgba(124, 58, 237, 0.24);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 0.95rem 1rem;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.modal-header h3 {
  margin: 0;
  font-size: 1.08rem;
}

.modal-close-btn {
  padding: 0.42rem 0.58rem;
}

.draft-sections-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.segment-fields {
  display: grid;
  gap: 12px;
}

.segment-card {
  border: 1px solid rgba(124, 58, 237, 0.16);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 245, 255, 0.98));
  padding: 12px;
  display: grid;
  gap: 12px;
}

.segment-card-warning {
  border-color: rgba(198, 52, 52, 0.38);
  box-shadow: inset 0 0 0 1px rgba(198, 52, 52, 0.08);
}

.segment-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.segment-token {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(124, 58, 237, 0.12);
  border: 1px solid rgba(124, 58, 237, 0.18);
  color: #5b21b6;
  padding: 4px 10px;
  font-size: 0.72rem;
  font-weight: 700;
}

.segment-source {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(124, 58, 237, 0.14);
  border-radius: 12px;
  background: rgba(248, 245, 255, 0.92);
  padding: 10px;
}

.segment-source-label {
  font-size: 0.74rem;
  font-weight: 700;
  color: #6e5ea1;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.segment-source-copy {
  white-space: pre-wrap;
  line-height: 1.55;
  color: #3b2a66;
}

.draft-preview-wrap {
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid rgba(124, 58, 237, 0.16);
  background: rgba(255, 255, 255, 0.98);
  height: 100%;
  min-height: 0;
}

#draftPreviewFrame {
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 0;
  background: #fff;
  display: block;
}

.warning-stack {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.warning-card {
  border-radius: 12px;
  border: 1px solid rgba(198, 52, 52, 0.24);
  background: rgba(255, 241, 241, 0.95);
  padding: 11px 12px;
  display: grid;
  gap: 4px;
}

.warning-card strong {
  color: #8b1d1d;
}

.warning-card p {
  margin: 0;
  color: #8b1d1d;
}

.template-search-layout {
  display: grid;
  grid-template-columns: minmax(250px, 26%) 1fr;
  gap: 14px;
  align-items: start;
}

.template-filter-sidebar {
  position: sticky;
  top: 10px;
  border: 1px solid rgba(124, 58, 237, 0.16);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 245, 255, 0.96));
  padding: 12px;
}

.template-live-search-wrap {
  margin-bottom: 12px;
}

.template-link-grid {
  display: grid;
  gap: 10px;
}

.filter-field {
  display: grid;
  gap: 6px;
}

.select-shell {
  position: relative;
}

.select-shell::after {
  content: "";
  position: absolute;
  right: 10px;
  top: 50%;
  width: 10px;
  height: 6px;
  transform: translateY(-50%);
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%235b21b6' d='M5 6 .67.75h8.66z'/%3E%3C/svg%3E");
  background-size: 10px 6px;
  background-repeat: no-repeat;
}

.filter-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  width: 100%;
  border-radius: 10px;
  border: 1px solid #d7c9fb;
  background: var(--surface);
  color: #2a1652;
  padding: 0.62rem 2rem 0.62rem 0.66rem;
  font-size: 0.84rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.filter-select:hover {
  border-color: #c1abfb;
  background: #f5efff;
}

.filter-select option {
  background: #f8f5ff;
  color: #2a1652;
  font-size: 0.84rem;
}

.template-preview-area {
  display: grid;
  gap: 10px;
}

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

.template-teaser-grid.empty {
  border: 1px dashed rgba(124, 58, 237, 0.2);
  border-radius: 12px;
  padding: 12px;
  background: rgba(248, 245, 255, 0.8);
}

.template-teaser-card {
  text-decoration: none;
  color: inherit;
  display: grid;
  gap: 8px;
  border: 1px solid rgba(124, 58, 237, 0.18);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 245, 255, 0.95));
  padding: 10px;
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
}

.template-teaser-card:hover {
  transform: translateY(-1px);
  border-color: rgba(124, 58, 237, 0.35);
  box-shadow: 0 10px 22px rgba(76, 29, 149, 0.14);
}

.template-teaser-frame-wrap {
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(124, 58, 237, 0.14);
  background: #fff;
  height: 210px;
}

.template-teaser-frame {
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

.template-teaser-title {
  margin: 0;
  font-size: 0.9rem;
  color: #2a1652;
  line-height: 1.25;
}

.template-teaser-meta {
  margin: 0;
  color: #5f4c93;
  font-size: 0.74rem;
}

.template-teaser-text {
  margin: 0;
  color: #3d2b6c;
  font-size: 0.78rem;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (max-width: 980px) {
  .hero-top {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-actions {
    width: 100%;
    align-items: flex-start;
  }

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

  .draft-selection-grid,
  .draft-layout {
    grid-template-columns: 1fr;
  }

  .draft-editor-panel,
  .draft-preview-panel {
    min-height: auto;
  }

  .draft-preview-panel {
    position: static;
    top: auto;
    align-self: auto;
    height: auto;
  }

  .draft-preview-wrap {
    height: 72vh;
    min-height: 520px;
  }

  #draftPreviewFrame {
    min-height: 520px;
  }

  .template-search-layout {
    grid-template-columns: 1fr;
  }

  .template-filter-sidebar {
    position: static;
    top: auto;
  }

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

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

@media (max-width: 620px) {
  .container {
    width: calc(100% - 1rem);
  }

  .panel {
    padding: 0.85rem;
    border-radius: 14px;
  }

  .auth-actions-wrap {
    flex-direction: column;
    align-items: stretch;
  }

  .auth-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .draft-toolbar-actions,
  .draft-meta-row,
  .draft-sections-head {
    align-items: stretch;
  }

  .draft-toolbar-actions .btn {
    width: 100%;
  }

  .segment-card {
    padding: 10px;
  }

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

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