:root {
  --bg: #07111f;
  --bg-deep: #030812;
  --panel: #0d1b2d;
  --line: rgba(255, 255, 255, 0.11);
  --ink: #eef7ff;
  --muted: #9fb1c7;
  --blue: #36b7ff;
  --cyan: #62e1ff;
  --paper-ink: #102033;
  --paper-muted: #657489;
  --paper-line: #dce5ee;
  --paper-soft: #f3f7fb;
  --success: #16a36a;
  --danger: #ff8e9d;
  --shadow: 0 30px 90px rgba(0, 0, 0, 0.34);
}

* { box-sizing: border-box; }

html {
  min-width: 320px;
  background: var(--bg-deep);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 12% 0%, rgba(54, 183, 255, 0.16), transparent 30%),
    radial-gradient(circle at 90% 8%, rgba(98, 225, 255, 0.11), transparent 28%),
    linear-gradient(180deg, #07111f 0%, #050b14 100%);
}

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

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

button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
.app-shell { min-height: 100vh; }

.topbar {
  width: min(1460px, calc(100% - 40px));
  margin: 0 auto;
  min-height: 84px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-logo {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.06);
}

.brand-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 5px;
}

.brand-fallback {
  font-weight: 900;
  letter-spacing: -0.08em;
  color: var(--cyan);
}

.brand-copy { display: grid; gap: 2px; }
.brand-copy strong { font-size: 0.96rem; }
.brand-copy small {
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.back-link {
  color: #b9c7d8;
  font-size: 0.82rem;
  font-weight: 650;
  padding: 9px 13px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
  transition: 160ms ease;
}

.back-link:hover { color: #fff; border-color: rgba(98, 225, 255, 0.36); }

.workspace {
  width: min(1460px, calc(100% - 40px));
  margin: 0 auto;
  padding: 30px 0 50px;
  display: grid;
  grid-template-columns: minmax(380px, 0.76fr) minmax(560px, 1.24fr);
  gap: 28px;
  align-items: start;
}

.editor-panel,
.preview-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.editor-panel {
  position: sticky;
  top: 20px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding: 28px;
  background: linear-gradient(180deg, rgba(15, 31, 52, 0.96), rgba(7, 17, 31, 0.98));
  backdrop-filter: blur(18px);
  scrollbar-width: thin;
  scrollbar-color: rgba(98, 225, 255, 0.24) transparent;
}

.panel-heading { margin-bottom: 24px; }
.eyebrow {
  display: inline-flex;
  color: var(--cyan);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  margin-bottom: 11px;
}

.panel-heading h1 {
  margin: 0;
  font-size: clamp(1.65rem, 2.3vw, 2.35rem);
  letter-spacing: -0.045em;
  line-height: 1.05;
}

.panel-heading p {
  margin: 13px 0 0;
  max-width: 58ch;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.65;
}

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

.field { display: grid; gap: 8px; min-width: 0; }
.field-wide { grid-column: 1 / -1; }
.field > span:first-child {
  color: #dce8f5;
  font-size: 0.75rem;
  font-weight: 700;
}
.field b { color: var(--cyan); }

.field-label-line {
  display: flex;
  align-items: center;
  gap: 5px;
}
.field-optional[hidden] { display: none !important; }
.field-optional {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  padding: 2px 7px;
  border: 1px solid rgba(98, 225, 255, 0.16);
  border-radius: 999px;
  color: #9adcf4;
  background: rgba(54, 183, 255, 0.06);
  font-size: 0.53rem;
  font-style: normal;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.field-help {
  display: block;
  margin-top: 6px;
  color: #7f95ac;
  font-size: 0.62rem;
  font-weight: 500;
  line-height: 1.42;
}
.email-purpose-account .username-field {
  padding: 10px;
  border: 1px solid rgba(54, 183, 255, 0.12);
  border-radius: 14px;
  background: rgba(54, 183, 255, 0.035);
}

.field input,
.field textarea,
.field select {
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  outline: 0;
  color: #f8fbff;
  background: rgba(0, 0, 0, 0.2);
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.field input,
.field select { height: 48px; padding: 0 14px; }
.field textarea { min-height: 82px; resize: vertical; padding: 13px 14px; }
.field select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #8fa6bf 50%),
    linear-gradient(135deg, #8fa6bf 50%, transparent 50%);
  background-position: calc(100% - 18px) 21px, calc(100% - 13px) 21px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
.field select option { color: #102033; background: #fff; }
.field input::placeholder,
.field textarea::placeholder { color: #71849a; }

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: rgba(54, 183, 255, 0.72);
  background: rgba(0, 0, 0, 0.3);
  box-shadow: 0 0 0 4px rgba(54, 183, 255, 0.11);
}

.password-wrap { position: relative; display: block; }
.password-wrap input { padding-right: 94px; }
.password-wrap.is-static input { padding-right: 14px; }
.password-wrap.is-generated input {
  color: #ccefff;
  background: rgba(54, 183, 255, 0.055);
  font-weight: 750;
  letter-spacing: 0.02em;
}
.password-wrap.is-generated input[readonly] { cursor: text; }
.field-action {
  position: absolute;
  top: 50%;
  right: 7px;
  transform: translateY(-50%);
  height: 34px;
  border: 1px solid rgba(98, 225, 255, 0.18);
  border-radius: 10px;
  color: #bceeff;
  background: rgba(54, 183, 255, 0.09);
  font-size: 0.68rem;
  font-weight: 800;
}

.accounts-editor-section {
  margin-top: 26px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.section-heading-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.section-heading-row > div { min-width: 0; }
.section-kicker {
  display: block;
  color: var(--cyan);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.section-heading-row h2 {
  margin: 0;
  font-size: 1.08rem;
  letter-spacing: -0.025em;
}
.section-heading-row p {
  margin: 6px 0 0;
  color: #8296ad;
  font-size: 0.72rem;
  line-height: 1.45;
}

.account-count-badge {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  border: 1px solid rgba(98, 225, 255, 0.18);
  border-radius: 999px;
  color: #bdefff;
  background: rgba(54, 183, 255, 0.08);
  font-size: 0.65rem;
  font-weight: 800;
}

.accounts-editor-list { display: grid; gap: 14px; }
.account-editor-card {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.035);
}

.account-editor-header {
  min-height: 58px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.025);
}

.account-editor-header > div:first-child {
  display: grid;
  gap: 3px;
  min-width: 0;
}
.account-order {
  color: #70dfff;
  font-size: 0.56rem;
  font-weight: 800;
  letter-spacing: 0.13em;
}
.account-editor-title {
  overflow: hidden;
  color: #ecf7ff;
  font-size: 0.78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account-card-actions { display: flex; gap: 6px; flex: 0 0 auto; }
.account-action {
  min-height: 30px;
  padding: 5px 9px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 9px;
  color: #a9bbce;
  background: rgba(255, 255, 255, 0.035);
  font-size: 0.61rem;
  font-weight: 750;
}
.account-action:hover { color: #fff; border-color: rgba(98, 225, 255, 0.25); }
.remove-account { color: #d8a7ae; }
.remove-account:disabled {
  opacity: 0.28;
  cursor: not-allowed;
}
.account-fields { padding: 16px; }

.add-account-button {
  width: 100%;
  min-height: 44px;
  margin-top: 13px;
  border: 1px dashed rgba(98, 225, 255, 0.28);
  border-radius: 13px;
  color: #c6efff;
  background: rgba(54, 183, 255, 0.045);
  font-size: 0.75rem;
  font-weight: 800;
  transition: 150ms ease;
}
.add-account-button:hover {
  border-color: rgba(98, 225, 255, 0.52);
  background: rgba(54, 183, 255, 0.085);
}
.add-account-button span { margin-right: 5px; font-size: 1rem; }

.email-composer-section {
  margin-top: 26px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.email-heading-row { margin-bottom: 14px; }
.email-ready-badge {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 27px;
  padding: 5px 9px;
  border: 1px solid rgba(53, 201, 143, 0.22);
  border-radius: 999px;
  color: #8fe4bd;
  background: rgba(53, 201, 143, 0.07);
  font-size: 0.58rem;
  font-weight: 850;
  letter-spacing: 0.08em;
}

.email-preview-card {
  overflow: hidden;
  border: 1px solid rgba(98, 225, 255, 0.14);
  border-radius: 17px;
  background: linear-gradient(180deg, rgba(54, 183, 255, 0.05), rgba(255, 255, 255, 0.025));
}

.email-subject-preview {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.025);
}
.email-subject-preview span {
  color: #70dfff;
  font-size: 0.54rem;
  font-weight: 850;
  letter-spacing: 0.13em;
}
.email-subject-preview strong {
  overflow-wrap: anywhere;
  color: #eff9ff;
  font-size: 0.78rem;
  line-height: 1.4;
}

.email-body-preview {
  margin: 0;
  padding: 15px;
  overflow: visible;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: #b9cadd;
  background: rgba(0, 0, 0, 0.11);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.7rem;
  line-height: 1.62;
  scrollbar-width: thin;
  scrollbar-color: rgba(98, 225, 255, 0.24) transparent;
}

.email-copy-actions {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 8px;
  padding: 11px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.email-copy-button {
  min-height: 38px;
  padding: 8px 11px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 11px;
  color: #d4e2ef;
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.7rem;
  font-weight: 800;
  transition: 150ms ease;
}
.email-copy-button:hover {
  transform: translateY(-1px);
  border-color: rgba(98, 225, 255, 0.3);
}
.email-copy-primary {
  color: #03111e;
  border-color: transparent;
  background: linear-gradient(135deg, #72e5ff, #37b7ff);
}

.check-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 18px 0 0;
  color: #aebed0;
  font-size: 0.77rem;
  line-height: 1.45;
}
.check-row input { width: 16px; height: 16px; flex: 0 0 auto; accent-color: var(--blue); }

.form-actions {
  display: grid;
  grid-template-columns: 0.72fr 1fr 1.15fr;
  gap: 10px;
  margin-top: 22px;
}

.btn,
.mini-button {
  border: 0;
  border-radius: 13px;
  font-weight: 750;
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease;
}
.btn { min-height: 45px; padding: 10px 13px; font-size: 0.78rem; }
.btn:hover,
.mini-button:hover { transform: translateY(-1px); }
.btn-primary {
  color: #03111e;
  background: linear-gradient(135deg, #72e5ff, #37b7ff);
  box-shadow: 0 12px 30px rgba(54, 183, 255, 0.2);
}
.btn-secondary {
  color: #d4e2ef;
  border: 1px solid rgba(255, 255, 255, 0.11);
  background: rgba(255, 255, 255, 0.045);
}

.privacy-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 16px 0 0;
  color: #71879e;
  font-size: 0.68rem;
  line-height: 1.5;
}
.privacy-note span { color: #35c98f; }

.preview-panel {
  padding: 18px;
  background: rgba(255, 255, 255, 0.035);
  overflow: hidden;
}
.preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 2px 4px 16px;
}
.preview-toolbar > div { display: grid; gap: 2px; }
.preview-toolbar span { font-size: 0.8rem; font-weight: 750; }
.preview-toolbar small { color: var(--muted); font-size: 0.68rem; }
.mini-button {
  min-height: 34px;
  padding: 7px 12px;
  color: #b7c7d8;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.68rem;
}

.access-document {
  position: relative;
  width: min(100%, 816px);
  min-height: 1056px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: var(--paper-ink);
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.24);
}

.doc-accent {
  position: absolute;
  inset: 0 0 auto;
  height: 8px;
  background: linear-gradient(90deg, #0c2e52, #1e8ee9 55%, #61d7f2);
}

.doc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 38px 46px 26px;
  border-bottom: 1px solid var(--paper-line);
}

.doc-brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.doc-logo {
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
  display: grid;
  place-items: center;
  border: 1px solid #dce7f0;
  border-radius: 17px;
  background: #f7fafc;
  overflow: hidden;
}
.doc-logo img { width: 100%; height: 100%; object-fit: contain; padding: 6px; }
.doc-logo-fallback { color: #148dd0; font-size: 1.18rem; font-weight: 900; letter-spacing: -0.08em; }
.doc-brand > div:last-child { display: grid; gap: 5px; }
.doc-brand strong { font-size: 1.03rem; letter-spacing: -0.02em; }
.doc-brand span { color: var(--paper-muted); font-size: 0.62rem; letter-spacing: 0.08em; text-transform: uppercase; }
.doc-meta { display: grid; justify-items: end; gap: 4px; text-align: right; }
.doc-meta span { color: #2788c5; font-size: 0.58rem; font-weight: 800; letter-spacing: 0.14em; }
.doc-meta strong { font-size: 0.72rem; }
.doc-meta small { color: var(--paper-muted); font-size: 0.54rem; letter-spacing: 0.08em; }

.doc-intro { padding: 34px 46px 23px; }
.doc-kicker { color: #2188ca; font-size: 0.6rem; font-weight: 800; letter-spacing: 0.15em; }
.doc-intro h2 { margin: 10px 0 8px; font-size: 2.1rem; letter-spacing: -0.055em; line-height: 1; }
.doc-intro p { max-width: 650px; margin: 0; color: var(--paper-muted); font-size: 0.8rem; line-height: 1.55; }

.client-summary {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 20px;
  margin: 0 46px 22px;
  padding: 17px 20px;
  border: 1px solid var(--paper-line);
  border-radius: 15px;
  background: var(--paper-soft);
}
.client-summary > div { display: grid; align-content: start; gap: 5px; min-width: 0; }
.client-summary span,
.account-credential-label,
.account-notes > span { color: #668098; font-size: 0.54rem; font-weight: 800; letter-spacing: 0.12em; }
.client-summary strong { font-size: 0.8rem; overflow-wrap: anywhere; }
.client-summary small { color: var(--paper-muted); font-size: 0.6rem; overflow-wrap: anywhere; }
.client-summary > div:last-child {
  padding-left: 18px;
  border-left: 1px solid var(--paper-line);
}
.client-summary > div:last-child strong { color: #145f91; }

.accounts-preview-section { margin: 0 46px; }
.preview-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 10px;
}
.preview-section-heading span {
  color: #49647e;
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.13em;
}
.preview-section-heading small {
  min-width: 28px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 1px solid #d5e6f1;
  border-radius: 8px;
  color: #1676ad;
  background: #edf8fd;
  font-size: 0.58rem;
  font-weight: 800;
}

.preview-accounts-list { display: grid; gap: 13px; }
.account-preview-card {
  overflow: hidden;
  border: 1px solid var(--paper-line);
  border-radius: 16px;
  background: #fff;
  break-inside: avoid;
  page-break-inside: avoid;
}
.account-preview-header {
  min-height: 58px;
  display: grid;
  grid-template-columns: 42px 1fr;
  align-items: center;
  gap: 13px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--paper-line);
  background: linear-gradient(90deg, #f5f9fc, #fbfdff);
}
.account-number {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  color: #fff;
  background: linear-gradient(145deg, #11699e, #2aa8df);
  font-size: 0.65rem;
  font-weight: 900;
}
.account-preview-header > div:last-child { display: grid; gap: 3px; min-width: 0; }
.preview-account-purpose {
  color: #68829a;
  font-size: 0.49rem;
  font-weight: 800;
  letter-spacing: 0.11em;
}
.preview-account-service {
  font-size: 0.82rem;
  letter-spacing: -0.015em;
  overflow-wrap: anywhere;
}
.preview-account-purpose-value {
  color: #1675aa;
  font-size: 0.58rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.account-credential-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.account-credential-item {
  min-height: 61px;
  display: grid;
  align-content: center;
  gap: 5px;
  padding: 12px 16px;
  border-right: 1px solid var(--paper-line);
  border-bottom: 1px solid var(--paper-line);
  min-width: 0;
}
.account-credential-item:nth-child(2n) { border-right: 0; }
.account-credential-item:nth-last-child(-n + 2) { border-bottom: 0; }
.account-credential-grid.without-username .password-item {
  grid-column: 1 / -1;
  border-right: 0;
  border-bottom: 0;
}
.account-credential-item[hidden] { display: none; }
.account-credential-item strong {
  font-size: 0.68rem;
  letter-spacing: -0.005em;
  overflow-wrap: anywhere;
}
.password-item strong { color: #0b5d8d; font-size: 0.73rem; letter-spacing: 0.025em; }

.account-notes {
  padding: 11px 16px 13px;
  border-top: 1px solid var(--paper-line);
  background: #f8fafc;
}
.account-notes p {
  margin: 5px 0 0;
  color: #53667b;
  font-size: 0.59rem;
  line-height: 1.45;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.security-notice {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 12px;
  align-items: start;
  margin: 20px 46px 0;
  padding: 14px 16px;
  border: 1px solid #cce9dd;
  border-radius: 14px;
  background: #f1fbf6;
  break-inside: avoid;
  page-break-inside: avoid;
}
.security-mark {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  color: #fff;
  border-radius: 50%;
  background: var(--success);
  font-size: 0.78rem;
  font-weight: 900;
}
.security-notice strong { display: block; margin-bottom: 4px; color: #176643; font-size: 0.68rem; }
.security-notice p { margin: 0; color: #537565; font-size: 0.61rem; line-height: 1.48; }

.doc-footer {
  margin: auto 46px 24px;
  display: grid;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--paper-line);
  break-inside: avoid;
  page-break-inside: avoid;
}
.footer-security {
  display: grid;
  gap: 5px;
  padding: 10px 12px;
  border: 1px solid #dfe7ef;
  border-radius: 10px;
  background: #f8fafc;
}
.footer-security strong {
  color: #41566d;
  font-size: 0.53rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.footer-security p {
  margin: 0;
  color: #68798b;
  font-size: 0.47rem;
  line-height: 1.45;
}
.footer-meta {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}
.footer-meta > div { display: grid; gap: 4px; }
.footer-meta strong { font-size: 0.65rem; }
.footer-meta span { color: var(--paper-muted); font-size: 0.52rem; }
.footer-meta small { max-width: 330px; color: #8290a0; font-size: 0.44rem; line-height: 1.42; text-align: right; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 30;
  max-width: min(90vw, 440px);
  padding: 12px 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  color: #eaf5ff;
  background: rgba(6, 17, 30, 0.94);
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.35);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 10px);
  transition: 180ms ease;
  font-size: 0.75rem;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.is-hidden { display: none !important; }


/* V7 compact document layout -------------------------------------------------
   Keeps account blocks together while reducing wasted vertical space.
   Batch mode activates automatically when the document has 3+ accounts. */
.access-document {
  min-height: 1056px;
}

.doc-header {
  gap: 18px;
  padding: 24px 34px 15px;
}
.doc-logo {
  width: 44px;
  height: 44px;
  flex-basis: 44px;
  border-radius: 13px;
}
.doc-brand { gap: 11px; }
.doc-brand > div:last-child { gap: 3px; }
.doc-brand strong { font-size: 0.88rem; }
.doc-brand span { font-size: 0.52rem; }
.doc-meta { gap: 2px; }
.doc-meta span { font-size: 0.5rem; }
.doc-meta strong { font-size: 0.64rem; }
.doc-meta small { font-size: 0.47rem; }

.doc-intro { padding: 16px 34px 12px; }
.doc-kicker { font-size: 0.52rem; }
.doc-intro h2 { margin: 6px 0 5px; font-size: 1.6rem; }
.doc-intro p { font-size: 0.67rem; line-height: 1.4; }

.client-summary {
  gap: 14px;
  margin: 0 34px 11px;
  padding: 10px 13px;
  border-radius: 10px;
}
.client-summary > div { gap: 3px; }
.client-summary span,
.account-credential-label,
.account-notes > span { font-size: 0.47rem; }
.client-summary strong { font-size: 0.69rem; }
.client-summary small { font-size: 0.5rem; }
.client-summary > div:last-child { padding-left: 13px; }

.accounts-preview-section { margin: 0 34px; }
.preview-section-heading { margin-bottom: 6px; }
.preview-section-heading span { font-size: 0.51rem; }
.preview-section-heading small {
  min-width: 24px;
  height: 20px;
  border-radius: 6px;
  font-size: 0.51rem;
}
.preview-accounts-list { gap: 7px; }
.account-preview-card { border-radius: 10px; }
.account-preview-header {
  min-height: 42px;
  grid-template-columns: 30px 1fr;
  gap: 9px;
  padding: 7px 10px;
}
.account-number {
  width: 27px;
  height: 27px;
  border-radius: 8px;
  font-size: 0.55rem;
}
.account-preview-header > div:last-child { gap: 1px; }
.preview-account-purpose { font-size: 0.4rem; }
.preview-account-service { font-size: 0.7rem; }
.preview-account-purpose-value { font-size: 0.5rem; }

.account-credential-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.account-credential-grid.credential-count-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.account-credential-grid.credential-count-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.account-credential-grid.credential-count-1 { grid-template-columns: 1fr; }
.account-credential-item {
  min-height: 47px;
  gap: 3px;
  padding: 7px 10px;
  border-right: 1px solid var(--paper-line);
  border-bottom: 0;
}
.account-credential-item:last-child { border-right: 0; }
.account-credential-item:nth-child(2n) { border-right: 1px solid var(--paper-line); }
.account-credential-grid.credential-count-2 .account-credential-item:last-child,
.account-credential-grid.credential-count-3 .account-credential-item:last-child,
.account-credential-grid.credential-count-4 .account-credential-item:last-child { border-right: 0; }
.account-credential-item[hidden] { display: none !important; }
.account-credential-item strong { font-size: 0.58rem; line-height: 1.2; }
.password-item strong { font-size: 0.62rem; }

.account-notes[hidden] { display: none !important; }
.account-notes {
  padding: 6px 10px 7px;
}
.account-notes p {
  margin: 3px 0 0;
  font-size: 0.51rem;
  line-height: 1.34;
}

.security-notice {
  grid-template-columns: 25px 1fr;
  gap: 9px;
  margin: 10px 34px 0;
  padding: 8px 10px;
  border-radius: 9px;
}
.security-mark {
  width: 23px;
  height: 23px;
  font-size: 0.62rem;
}
.security-notice strong { margin-bottom: 2px; font-size: 0.57rem; }
.security-notice p { font-size: 0.5rem; line-height: 1.35; }

.doc-footer {
  margin: 10px 34px 14px;
  gap: 7px;
  padding-top: 9px;
}
.footer-security {
  gap: 3px;
  padding: 7px 9px;
  border-radius: 8px;
}
.footer-security strong { font-size: 0.46rem; }
.footer-security p { font-size: 0.405rem; line-height: 1.35; }
.footer-meta { gap: 16px; }
.footer-meta > div { gap: 2px; }
.footer-meta strong { font-size: 0.56rem; }
.footer-meta span { font-size: 0.44rem; }
.footer-meta small { max-width: 315px; font-size: 0.37rem; line-height: 1.32; }

/* Automatic extra compression for batch documents. */
.access-document.is-batch-compact .doc-header { padding-top: 20px; padding-bottom: 12px; }
.access-document.is-batch-compact .doc-logo {
  width: 39px;
  height: 39px;
  flex-basis: 39px;
  border-radius: 11px;
}
.access-document.is-batch-compact .doc-intro { padding-top: 12px; padding-bottom: 9px; }
.access-document.is-batch-compact .doc-intro h2 { font-size: 1.42rem; }
.access-document.is-batch-compact .doc-intro p { font-size: 0.6rem; }
.access-document.is-batch-compact .client-summary { margin-bottom: 8px; padding-top: 8px; padding-bottom: 8px; }
.access-document.is-batch-compact .preview-accounts-list { gap: 5px; }
.access-document.is-batch-compact .account-preview-header {
  min-height: 36px;
  grid-template-columns: 26px 1fr;
  padding: 5px 8px;
}
.access-document.is-batch-compact .account-number {
  width: 23px;
  height: 23px;
  border-radius: 7px;
  font-size: 0.49rem;
}
.access-document.is-batch-compact .preview-account-purpose { display: none; }
.access-document.is-batch-compact .preview-account-service { font-size: 0.64rem; }
.access-document.is-batch-compact .preview-account-purpose-value { font-size: 0.46rem; }
.access-document.is-batch-compact .account-credential-item {
  min-height: 40px;
  padding: 5px 8px;
}
.access-document.is-batch-compact .account-credential-item strong { font-size: 0.53rem; }
.access-document.is-batch-compact .password-item strong { font-size: 0.56rem; }
.access-document.is-batch-compact .account-notes { padding: 5px 8px; }
.access-document.is-batch-compact .account-notes p { font-size: 0.47rem; }
.access-document.is-batch-compact .security-notice { margin-top: 8px; padding-top: 7px; padding-bottom: 7px; }
.access-document.is-batch-compact .doc-footer { margin-top: 8px; }

/* Seven or more accounts: preserve readability but remove nonessential copy. */
.access-document.is-large-batch .doc-intro p,
.access-document.is-large-batch .client-summary small,
.access-document.is-large-batch .footer-meta span { display: none; }
.access-document.is-large-batch .doc-intro { padding-top: 9px; padding-bottom: 7px; }
.access-document.is-large-batch .doc-intro h2 { margin-bottom: 0; }
.access-document.is-large-batch .client-summary { padding-top: 7px; padding-bottom: 7px; }

@media (max-width: 1120px) {
  .workspace { grid-template-columns: 1fr; }
  .editor-panel { position: static; max-height: none; overflow: visible; }
}

@media (max-width: 720px) {
  .topbar,
  .workspace { width: min(100% - 24px, 1460px); }
  .topbar { min-height: 72px; }
  .brand-logo { width: 40px; height: 40px; flex-basis: 40px; border-radius: 13px; }
  .brand-copy small { display: none; }
  .back-link { padding: 8px 11px; font-size: 0.7rem; }
  .workspace { padding-top: 18px; gap: 18px; }
  .editor-panel { padding: 22px 18px; border-radius: 22px; }
  .preview-panel { padding: 10px; border-radius: 22px; }
  .form-grid { grid-template-columns: 1fr; }
  .field-wide { grid-column: auto; }
  .form-actions { grid-template-columns: 1fr; }
  .email-copy-actions { grid-template-columns: 1fr; }
  .section-heading-row { align-items: center; }
  .account-editor-header { align-items: flex-start; }
  .account-card-actions { flex-direction: column; }
  .account-action { min-height: 27px; padding: 4px 8px; }

  .access-document {
    width: 816px;
    min-height: 1056px;
    transform-origin: top left;
  }

  .preview-panel { overflow-x: auto; }
  .preview-toolbar {
    position: sticky;
    left: 0;
    width: calc(100vw - 44px);
  }
}

@media print {
  @page { size: letter; margin: 0; }
  html, body { width: 8.5in; min-width: 0; background: #fff !important; }
  body { margin: 0; }
  .no-pdf,
  .toast { display: none !important; }
  .app-shell,
  .workspace,
  .preview-panel {
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    display: block !important;
    border: 0 !important;
    box-shadow: none !important;
    background: #fff !important;
  }
  .access-document {
    width: 8.5in !important;
    min-height: 11in !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    overflow: visible !important;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
  .account-preview-card,
  .security-notice,
  .doc-footer {
    break-inside: avoid !important;
    page-break-inside: avoid !important;
  }
}
