:root {
  color-scheme: light;
  --ink: #111827;
  --muted: #64748b;
  --line: #e2e8f0;
  --soft: #f8fafc;
  --panel: #ffffff;
  --accent: #007aff;
  --accent-2: #006ee6;
  --shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: #faf7f2;
  color: var(--ink);
  font-family: Inter, Arial, Helvetica, sans-serif;
}

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

button {
  cursor: pointer;
}

svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.app-shell {
  min-height: 100vh;
  background: #faf7f2;
  color: var(--ink);
}

.app-shell[data-app-theme="dark"] {
  color-scheme: dark;
  --ink: #e5e7eb;
  --muted: #94a3b8;
  --line: #273449;
  --soft: #111827;
  --panel: #0f172a;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.32);
  background: #0b1220;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 22px;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(14px);
}

.app-shell[data-app-theme="dark"] .topbar {
  background: rgba(15, 23, 42, 0.94);
}

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

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: #102a43;
  color: #ffffff;
  font-weight: 800;
}

.brand-lockup strong,
.brand-lockup small {
  display: block;
}

.brand-lockup small {
  color: var(--muted);
  font-size: 12px;
}

.topbar-actions,
.inline-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.primary-button,
.secondary-button,
.ghost-button,
.icon-button {
  border: 1px solid transparent;
  border-radius: 7px;
  min-height: 36px;
  padding: 8px 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-weight: 700;
  white-space: nowrap;
}

.icon-button {
  width: 38px;
  padding: 0;
  background: #ffffff;
  color: var(--ink);
  border-color: var(--line);
}

.primary-button {
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 10px 26px rgba(0, 122, 255, 0.22);
}

.secondary-button {
  background: #ffffff;
  color: var(--ink);
  border-color: var(--line);
}

.ghost-button {
  background: #ffffff;
  color: var(--ink);
  border-color: var(--line);
}

.app-shell[data-app-theme="dark"] .secondary-button,
.app-shell[data-app-theme="dark"] .ghost-button,
.app-shell[data-app-theme="dark"] .icon-button {
  background: #111827;
  color: var(--ink);
}

.save-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 700;
}

.app-shell[data-app-theme="dark"] .save-pill {
  background: #0f2547;
  border-color: #1d4e89;
}

.account-pill {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 700;
}

.app-shell[data-app-theme="dark"] .account-pill {
  background: #111827;
}

.workspace {
  display: grid;
  grid-template-columns: 224px minmax(500px, 650px) minmax(500px, 1fr);
  gap: 20px;
  padding: 20px;
  align-items: start;
}

.sidebar,
.editor-panel,
.preview-panel {
  background: transparent;
  border: 0;
  border-radius: 0;
}

.sidebar {
  position: sticky;
  top: 80px;
  padding: 0;
}

.capacity-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 14px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}

.app-shell[data-app-theme="dark"] .capacity-card,
.app-shell[data-app-theme="dark"] .asset-card,
.app-shell[data-app-theme="dark"] .metric-card,
.app-shell[data-app-theme="dark"] .instruction-card,
.app-shell[data-app-theme="dark"] .validation-card,
.app-shell[data-app-theme="dark"] .note-card,
.app-shell[data-app-theme="dark"] .install-card,
.app-shell[data-app-theme="dark"] .signature-row {
  background: #111827;
}

.capacity-card span,
.capacity-card small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.capacity-card strong {
  display: block;
  font-size: 28px;
  line-height: 1.1;
  margin: 4px 0 8px;
}

progress {
  width: 100%;
  height: 6px;
  accent-color: var(--accent);
}

.tab-list {
  display: grid;
  gap: 4px;
}

.tab-button {
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 9px 10px;
  text-align: left;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}

.tab-button.is-active {
  background: #ffffff;
  border-color: var(--line);
  color: var(--accent);
  box-shadow: inset 3px 0 0 var(--accent), 0 8px 22px rgba(15, 23, 42, 0.04);
}

.app-shell[data-app-theme="dark"] .tab-button.is-active {
  background: #111827;
}

.editor-panel {
  display: grid;
  gap: 14px;
  padding: 0;
}

.control-panel,
.mail-frame,
.output-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 14px 40px rgba(15, 23, 42, 0.05);
}

.section-heading,
.card-heading {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 14px;
}

.section-heading h2,
.section-heading p,
.card-heading h3 {
  margin: 0;
}

.section-heading p {
  color: var(--muted);
  font-size: 13px;
  margin-top: 2px;
}

.template-card,
.install-card,
.signature-row {
  border: 1px solid var(--line);
  background: #ffffff;
  border-radius: var(--radius);
  text-align: left;
}

.template-card.is-selected,
.install-card.is-selected,
.signature-row.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 12%, transparent), 0 12px 26px rgba(15, 23, 42, 0.06);
}

.control-panel {
  padding: 20px;
  overflow: hidden;
}

.control-panel:has(.template-setup) {
  padding: 0;
}

.panel-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.panel-title h1 {
  font-size: 21px;
  line-height: 1.15;
  margin: 0;
  letter-spacing: 0;
}

.panel-title p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  max-width: 520px;
}

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

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

.field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfdff;
  color: var(--ink);
  min-height: 40px;
  padding: 9px 10px;
  font-weight: 500;
}

.app-shell[data-app-theme="dark"] .field input,
.app-shell[data-app-theme="dark"] .field select,
.app-shell[data-app-theme="dark"] .field textarea,
.app-shell[data-app-theme="dark"] .output-code,
.app-shell[data-app-theme="dark"] .output-plain {
  background: #0b1220;
  color: var(--ink);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: 0;
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent);
  background: #ffffff;
}

.field textarea {
  resize: vertical;
  min-height: 110px;
  line-height: 1.45;
}

.field input[type="color"] {
  padding: 4px;
}

.range-field {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr) 34px;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.range-field input {
  width: 100%;
  accent-color: var(--accent);
}

.range-field output {
  color: var(--ink);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.image-fit-controls {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfdff;
  padding: 10px;
  display: grid;
  gap: 8px;
}

.app-shell[data-app-theme="dark"] .image-fit-controls,
.app-shell[data-app-theme="dark"] .asset-preview {
  background: #0b1220;
}

.image-fit-controls strong {
  font-size: 12px;
}

.range-pair {
  display: grid;
  gap: 7px;
}

.upload-control {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
  color: var(--accent);
  min-height: 38px;
  padding: 8px 11px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.app-shell[data-app-theme="dark"] .upload-control {
  background: #111827;
}

.upload-control > span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.full-width {
  grid-column: 1 / -1;
  margin-top: 13px;
}

.switch-row {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 14px 0 0;
  font-weight: 700;
}

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

.template-setup {
  display: grid;
  gap: 18px;
  padding: 20px;
  max-height: calc(100vh - 116px);
  overflow: auto;
}

.template-setup-header h1 {
  margin: 0;
  font-size: 21px;
  line-height: 1.15;
}

.template-setup-header p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

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

.template-group-title {
  margin: 0;
  color: #8b8175;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
}

.template-stack {
  display: grid;
  gap: 14px;
}

.template-option {
  display: grid;
  gap: 0;
  width: 100%;
  min-height: 235px;
  padding: 0;
  border: 1px solid #ebe5dd;
  border-radius: 8px;
  background: #ffffff;
  text-align: left;
  overflow: hidden;
  box-shadow: 0 8px 22px rgba(58, 45, 31, 0.07);
}

.template-option.is-selected {
  border-color: color-mix(in srgb, var(--accent) 58%, #ebe5dd);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 12%, transparent), 0 12px 28px rgba(37, 99, 235, 0.1);
}

.template-option-footer {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 12px;
  align-items: center;
  padding: 15px 20px 17px;
  border-top: 1px solid #dbeafe;
  background: #f6f9fd;
}

.template-option-footer strong {
  display: block;
  font-size: 17px;
  color: var(--ink);
}

.template-option-footer small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.template-radio {
  display: block;
  width: 23px;
  height: 23px;
  border-radius: 50%;
  border: 3px solid #d6d0c7;
}

.template-option.is-selected .template-radio {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 5px #ffffff;
  background: var(--accent);
}

.template-option.is-selected .template-option-footer {
  background: #eef6ff;
  border-top-color: #bfdbfe;
}

.app-shell[data-app-theme="dark"] .template-option {
  background: #ffffff;
  border-color: #e2e8f0;
}

.app-shell[data-app-theme="dark"] .template-option-footer {
  background: #f6f9fd;
  border-top-color: #dbeafe;
}

.app-shell[data-app-theme="dark"] .template-option.is-selected .template-option-footer {
  background: #eef6ff;
  border-top-color: #bfdbfe;
}

.app-shell[data-app-theme="dark"] .template-option-footer strong {
  color: #111827;
}

.app-shell[data-app-theme="dark"] .template-option-footer small {
  color: #64748b;
}

.template-preview {
  position: relative;
  display: block;
  height: 154px;
  background:
    linear-gradient(#ffffff, #ffffff) padding-box,
    linear-gradient(135deg, #eff6ff, #f8fafc) border-box;
  border-bottom: 1px solid #f0ebe4;
  overflow: hidden;
}

.template-preview > span {
  position: absolute;
  display: block;
}

.tp-photo {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid !important;
  place-items: center;
  background: linear-gradient(135deg, #0f172a, #64748b);
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
}

.tp-name,
.tp-role,
.tp-company,
.tp-email,
.tp-phone,
.tp-web {
  height: 14px;
  line-height: 14px;
  overflow: hidden;
  white-space: nowrap;
  border-radius: 3px;
  padding: 0 5px;
  font-size: 9px;
  letter-spacing: 0;
}

.tp-name {
  color: #111827;
  font-weight: 800;
  background: #f8fafc;
}

.tp-role,
.tp-company,
.tp-email,
.tp-phone,
.tp-web {
  color: #64748b;
  background: #f8fafc;
}

.tp-email,
.tp-phone,
.tp-web {
  padding-left: 15px;
}

.tp-email::before,
.tp-phone::before,
.tp-web::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 5px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

.tp-divider {
  width: 2px;
  background: var(--accent);
}

.tp-action,
.tp-cta {
  height: 18px;
  line-height: 18px;
  border-radius: 4px;
  text-align: center;
  font-size: 9px;
  font-weight: 800;
  color: #ffffff;
  background: var(--accent);
}

.tp-logo {
  height: 22px;
  line-height: 22px;
  border-radius: 4px;
  text-align: center;
  font-size: 11px;
  font-weight: 900;
  color: #111827;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
}

.tp-rule {
  height: 2px;
  background: var(--accent);
}

.tp-social {
  display: none;
  gap: 5px;
}

.tp-social span {
  position: static;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  color: #ffffff;
  background: #94a3b8;
  font-size: 7px;
  font-weight: 800;
}

.template-preview .tp-cta,
.template-preview .tp-divider,
.template-preview .tp-action,
.template-preview .tp-rule,
.template-preview .tp-social,
.template-preview .tp-logo,
.template-preview .tp-web,
.template-preview .tp-phone,
.template-preview .tp-company {
  display: none !important;
}

.template-preview-vertical-01 .tp-photo {
  left: 32px;
  top: 22px;
}

.template-preview-vertical-01 .tp-name {
  left: 112px;
  top: 24px;
  width: 80px;
}

.template-preview-vertical-01 .tp-role {
  left: 112px;
  top: 45px;
  width: 116px;
}

.template-preview-vertical-01 .tp-email {
  left: 112px;
  top: 76px;
  width: 152px;
}

.template-preview-vertical-01 .tp-action {
  display: block !important;
  left: 112px;
  top: 108px;
  width: 90px;
}

.template-preview-vertical-02 .tp-photo {
  left: 32px;
  top: 42px;
}

.template-preview-vertical-02 .tp-divider {
  display: block !important;
  left: 98px;
  top: 34px;
  height: 96px;
}

.template-preview-vertical-02 .tp-name {
  left: 124px;
  top: 40px;
  width: 82px;
}

.template-preview-vertical-02 .tp-role {
  left: 124px;
  top: 61px;
  width: 132px;
}

.template-preview-vertical-02 .tp-email {
  left: 124px;
  top: 92px;
  width: 152px;
}

.template-preview-vertical-02 .tp-action {
  display: block !important;
  left: 124px;
  top: 122px;
  width: 90px;
}

.template-preview-vertical-03 .tp-photo {
  left: 26px;
  top: 44px;
}

.template-preview-vertical-03 .tp-name {
  left: 86px;
  top: 38px;
  width: 76px;
}

.template-preview-vertical-03 .tp-role {
  left: 86px;
  top: 59px;
  width: 112px;
}

.template-preview-vertical-03 .tp-email {
  left: 86px;
  top: 88px;
  width: 136px;
}

.template-preview-vertical-03 .tp-social {
  display: flex !important;
  left: 232px;
  top: 88px;
}

.template-preview-single-column-01 .tp-photo,
.template-preview-single-column-02 .tp-photo,
.template-preview-single-column-03 .tp-photo {
  left: 26px;
  top: 28px;
}

.template-preview-single-column-01 .tp-name,
.template-preview-single-column-02 .tp-name,
.template-preview-single-column-03 .tp-name {
  left: 86px;
  top: 30px;
  width: 74px;
}

.template-preview-single-column-01 .tp-role,
.template-preview-single-column-02 .tp-role,
.template-preview-single-column-03 .tp-role {
  left: 86px;
  top: 51px;
  width: 124px;
}

.template-preview-single-column-01 .tp-email,
.template-preview-single-column-02 .tp-email,
.template-preview-single-column-03 .tp-email {
  left: 26px;
  top: 86px;
  width: 176px;
}

.template-preview-single-column-01 .tp-cta,
.template-preview-single-column-02 .tp-logo,
.template-preview-single-column-03 .tp-phone {
  display: block !important;
  left: 26px;
  top: 120px;
  width: 126px;
}

.template-preview-single-column-03 .tp-web {
  display: block !important;
  left: 172px;
  top: 120px;
  width: 108px;
}

.template-preview-two-column-01 .tp-photo,
.template-preview-two-column-02 .tp-photo,
.template-preview-two-column-03 .tp-photo,
.template-preview-two-column-04 .tp-photo {
  left: 28px;
  top: 42px;
}

.template-preview-two-column-01 .tp-divider,
.template-preview-two-column-02 .tp-divider,
.template-preview-two-column-03 .tp-divider,
.template-preview-two-column-04 .tp-divider {
  display: block !important;
  left: 150px;
  top: 34px;
  height: 92px;
}

.template-preview-two-column-01 .tp-name,
.template-preview-two-column-02 .tp-name,
.template-preview-two-column-03 .tp-name,
.template-preview-two-column-04 .tp-name {
  left: 86px;
  top: 43px;
  width: 58px;
}

.template-preview-two-column-01 .tp-role,
.template-preview-two-column-02 .tp-role,
.template-preview-two-column-03 .tp-role,
.template-preview-two-column-04 .tp-role {
  left: 86px;
  top: 64px;
  width: 54px;
}

.template-preview-two-column-01 .tp-email,
.template-preview-two-column-02 .tp-email,
.template-preview-two-column-03 .tp-email,
.template-preview-two-column-04 .tp-email {
  left: 176px;
  top: 40px;
  width: 142px;
}

.template-preview-two-column-01 .tp-phone,
.template-preview-two-column-02 .tp-phone,
.template-preview-two-column-03 .tp-phone,
.template-preview-two-column-04 .tp-phone {
  display: block !important;
  left: 176px;
  top: 63px;
  width: 92px;
}

.template-preview-two-column-01 .tp-web,
.template-preview-two-column-02 .tp-web,
.template-preview-two-column-03 .tp-web,
.template-preview-two-column-04 .tp-web {
  display: block !important;
  left: 176px;
  top: 86px;
  width: 118px;
}

.template-preview-two-column-02 .tp-logo,
.template-preview-two-column-03 .tp-logo,
.template-preview-two-column-04 .tp-logo {
  display: block !important;
  left: 28px;
  top: 124px;
  width: 112px;
}

.template-preview-two-column-01 .tp-action,
.template-preview-two-column-04 .tp-action {
  display: block !important;
  left: 86px;
  top: 94px;
  width: 58px;
}

.template-preview-two-column-04 .tp-action {
  top: 86px;
}

.template-preview-two-column-04 .tp-rule {
  display: block !important;
  left: 28px;
  right: 28px;
  top: 114px;
}

.template-preview-two-column-04 .tp-divider {
  height: 72px;
}

.template-card,
.install-card {
  padding: 13px;
  display: grid;
  gap: 8px;
  min-height: 120px;
}

.template-card small,
.install-card span,
.metric-card small,
.signature-row small {
  color: var(--muted);
  line-height: 1.35;
}

.template-compact {
  background: linear-gradient(#f8fafc 0 38%, #dbeafe 38% 44%, #f8fafc 44%);
}

.template-agency {
  background: linear-gradient(90deg, var(--accent) 0 10%, #f8fafc 10%);
}

.template-plain {
  background: repeating-linear-gradient(#f8fafc 0 10px, #e2e8f0 11px 12px);
}

.asset-card,
.metric-card,
.instruction-card,
.validation-card,
.note-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  padding: 14px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.035);
}

.asset-preview {
  display: grid;
  place-items: center;
  height: 116px;
  border-radius: 7px;
  background: #f8fafc;
  border: 1px dashed var(--line);
  color: var(--muted);
  margin-bottom: 12px;
}

.asset-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.asset-placeholder {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: #475569;
  font-weight: 800;
  letter-spacing: 0;
}

.asset-placeholder-avatar {
  border-radius: 50%;
  background:
    radial-gradient(circle at 72% 24%, rgba(147, 197, 253, 0.85) 0 12%, transparent 13%),
    linear-gradient(135deg, #007aff 0%, #0f172a 100%);
  color: #ffffff;
  font-size: 28px;
}

.asset-placeholder-logo,
.asset-placeholder-cta {
  border: 1px solid #dbe5ef;
  border-radius: 7px;
  background: #ffffff;
  color: #111827;
  font-size: 14px;
}

.asset-placeholder-cta {
  background: linear-gradient(135deg, #007aff, #0f172a);
  color: #ffffff;
  text-transform: uppercase;
}

.asset-preview-avatar {
  width: 116px;
  height: 116px;
  margin-left: auto;
  margin-right: auto;
  border-radius: 50%;
  overflow: hidden;
}

.asset-preview-avatar img {
  border-radius: 50%;
}

.asset-preview-logo img {
  object-fit: contain;
}

.asset-preview-cta {
  aspect-ratio: 3.77 / 1;
  height: auto;
}

.asset-card .upload-control {
  margin-top: 10px;
}

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

.metric-card strong {
  font-size: 26px;
  margin: 4px 0;
}

.signature-list,
.team-table {
  display: grid;
  gap: 8px;
}

.signature-row {
  width: 100%;
  min-height: 62px;
  display: grid;
  grid-template-columns: 42px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
}

.avatar-dot {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--accent);
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
}

.instruction-card {
  margin: 14px 0;
}

.instruction-card h3 {
  margin: 0 0 9px;
  font-size: 16px;
}

.instruction-card ol {
  margin: 0;
  padding-left: 21px;
  color: var(--muted);
  line-height: 1.55;
}

.validation-card {
  display: grid;
  gap: 7px;
  margin-top: 14px;
  color: #92400e;
  background: #fffbeb;
  border-color: #fde68a;
}

.validation-card.is-ok {
  display: flex;
  align-items: center;
  color: #006ee6;
  background: #eef7ff;
  border-color: #b8dcff;
}

.note-card {
  margin-top: 13px;
  color: var(--muted);
  line-height: 1.45;
}

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

.mail-frame {
  padding: 22px;
  min-height: 520px;
  transition: background 0.15s ease, color 0.15s ease;
}

.mail-frame-light {
  background: #ffffff;
}

.mail-frame-neutral {
  background: #f1f5f9;
}

.mail-frame-dark {
  background: #111827;
  color: #e5e7eb;
}

.mail-frame-dark .mail-header {
  border-color: #334155;
}

.mail-frame-dark .mail-header span {
  color: #cbd5e1;
}

.mail-frame-neutral .signature-preview {
  background: #f8fafc;
}

.mail-frame-dark .signature-preview {
  background: #111827;
  border-color: #334155;
}

.mail-header {
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
  margin-bottom: 20px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.mail-header > div {
  display: grid;
  gap: 5px;
}

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

.preview-mode-button {
  flex: 0 0 auto;
}

.signature-preview {
  min-height: 350px;
  overflow: auto;
  padding: 18px;
  background: transparent;
  border: 1px solid #edf2f7;
  border-radius: 7px;
}

.output-card {
  padding: 16px;
}

.output-code,
.output-plain {
  width: 100%;
  min-height: 140px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.45;
  resize: vertical;
}

.output-plain {
  min-height: 90px;
  margin-top: 10px;
}

.flash-message {
  position: fixed;
  right: 18px;
  bottom: 18px;
  background: #111827;
  color: #ffffff;
  border-radius: 7px;
  padding: 10px 12px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.16s ease, transform 0.16s ease;
  z-index: 30;
}

.flash-message.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.auth-shell {
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(250, 247, 242, 0.94)),
    #faf7f2;
}

.auth-landing {
  display: grid;
  grid-template-rows: auto 1fr;
  padding: 0;
}

.auth-nav {
  width: min(100%, 1180px);
  margin: 0 auto;
  padding: 22px 28px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.auth-nav-actions {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.auth-nav-link,
.auth-nav-cta {
  border: 1px solid transparent;
  border-radius: 7px;
  min-height: 36px;
  padding: 8px 13px;
  font-weight: 800;
}

.auth-nav-link {
  background: transparent;
  color: var(--muted);
}

.auth-nav-link.is-active {
  color: var(--ink);
}

.auth-nav-cta {
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 10px 24px rgba(0, 122, 255, 0.2);
}

.auth-nav-cta.is-active {
  background: #102a43;
}

.auth-hero {
  width: min(100%, 1180px);
  margin: 0 auto;
  padding: 72px 28px 48px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 430px);
  gap: 56px;
  align-items: center;
}

.auth-hero-single {
  grid-template-columns: minmax(0, 760px);
  justify-content: center;
}

.auth-copy {
  min-width: 0;
}

.auth-eyebrow,
.auth-panel-kicker {
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.auth-copy h1 {
  max-width: 760px;
  margin: 14px 0 16px;
  font-size: 68px;
  line-height: 0.96;
  letter-spacing: 0;
}

.auth-copy p {
  max-width: 620px;
  margin: 0;
  color: #475569;
  font-size: 19px;
  line-height: 1.55;
}

.auth-feature-list {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 24px;
}

.auth-feature-list span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border: 1px solid #dbeafe;
  border-radius: 999px;
  background: #ffffff;
  color: #1e3a8a;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 800;
}

.auth-preview-card {
  width: min(100%, 640px);
  margin-top: 34px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.11);
  padding: 28px;
}

.auth-preview-header,
.auth-preview-body {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}

.auth-preview-header strong,
.auth-preview-header small,
.auth-preview-body strong,
.auth-preview-body small,
.auth-preview-lines span {
  display: block;
}

.auth-avatar {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, #102a43, #4b5563);
  color: #ffffff;
  font-weight: 900;
}

.auth-preview-header small,
.auth-preview-body small,
.auth-preview-lines {
  color: var(--muted);
}

.auth-preview-body {
  grid-template-columns: minmax(0, 1fr) minmax(170px, 0.85fr);
  margin-top: 24px;
  padding-top: 22px;
  border-top: 2px solid var(--accent);
}

.auth-preview-lines {
  display: grid;
  gap: 7px;
  font-size: 13px;
}

.auth-preview-rule {
  width: 62%;
  height: 2px;
  margin-top: 24px;
  background: var(--accent);
}

.auth-card {
  width: min(100%, 430px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.12);
  padding: 28px;
}

.auth-card-wide {
  width: min(100%, 680px);
}

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

.auth-brand strong,
.auth-brand small {
  display: block;
}

.auth-brand small {
  color: var(--muted);
  font-size: 12px;
}

.auth-card h1,
.auth-card h2 {
  margin: 0;
  font-size: 26px;
  line-height: 1.15;
  letter-spacing: 0;
}

.auth-panel-kicker + h2 {
  margin-top: 10px;
}

.auth-card p {
  margin: 8px 0 18px;
  color: var(--muted);
  line-height: 1.45;
}

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

.auth-form .field {
  color: #475569;
}

.auth-form .field input {
  min-height: 46px;
  border-color: #dbe3ee;
  background: #ffffff;
  padding: 10px 12px;
}

.auth-form .field input::placeholder {
  color: #9aa7b8;
}

.auth-submit {
  width: 100%;
  min-height: 44px;
  margin-top: 4px;
}

.auth-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.auth-links button {
  border: 0;
  background: transparent;
  color: var(--accent);
  padding: 0;
  font-weight: 800;
}

.auth-security-note {
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.auth-message,
.auth-note {
  border: 1px solid #bfdbfe;
  border-radius: 7px;
  background: #eff6ff;
  color: #153e75;
  padding: 10px 12px;
  margin: 0 0 14px;
  line-height: 1.45;
}

.auth-steps {
  margin: 0;
  padding-left: 22px;
  color: var(--ink);
  line-height: 1.7;
}

.auth-steps code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  padding: 2px 4px;
}

.auth-note {
  margin-top: 18px;
  border-color: #fde68a;
  background: #fffbeb;
  color: #92400e;
}

@media (max-width: 1280px) {
  .workspace {
    grid-template-columns: 200px minmax(360px, 1fr);
  }

  .preview-panel {
    grid-column: 2;
  }

}

@media (max-width: 900px) {
  .auth-nav {
    padding: 18px 18px 0;
  }

  .auth-hero {
    grid-template-columns: 1fr;
    gap: 28px;
    padding: 44px 18px 34px;
  }

  .auth-copy h1 {
    font-size: 44px;
    line-height: 1.02;
  }

  .auth-copy p {
    font-size: 16px;
  }

  .auth-preview-card,
  .auth-card {
    width: 100%;
  }

  .auth-card {
    padding: 24px;
  }

  .topbar,
  .workspace {
    display: block;
  }

  .topbar-actions {
    margin-top: 12px;
  }

  .sidebar {
    position: static;
    margin: 12px;
  }

  .editor-panel,
  .preview-panel {
    margin: 12px;
  }

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

  .template-grid,
  .install-grid,
  .asset-grid,
  .metric-grid,
  .form-grid,
  .form-grid.compact {
    grid-template-columns: 1fr;
  }

  .panel-title {
    display: block;
  }

  .panel-title .secondary-button {
    margin-top: 10px;
  }
}

@media (max-width: 560px) {
  .auth-nav {
    align-items: flex-start;
    flex-direction: column;
  }

  .auth-nav-actions {
    width: 100%;
  }

  .auth-nav-link,
  .auth-nav-cta {
    flex: 1;
  }

  .auth-hero {
    padding-top: 34px;
  }

  .auth-copy h1 {
    font-size: 36px;
  }

  .auth-preview-body {
    grid-template-columns: 1fr;
  }

  .auth-preview-card {
    padding: 22px;
  }
}
