:root{--bg:#07111f;--panel:#0f1c2e;--panel2:#13243a;--text:#f7fbff;--muted:#9fb0c4;--line:rgba(255,255,255,.11);--brand:#67e8f9;--brand2:#0e7490;--dark:#020617}*{box-sizing:border-box}body{margin:0;background:linear-gradient(135deg,#07111f,#0b1220 45%,#111827);color:var(--text);font-family:Inter,ui-sans-serif,system-ui,-apple-system,Segoe UI,Arial,sans-serif}a{color:inherit;text-decoration:none}.site-header{height:72px;display:flex;align-items:center;justify-content:space-between;padding:0 32px;border-bottom:1px solid var(--line);background:rgba(7,17,31,.88);backdrop-filter:blur(12px);position:sticky;top:0;z-index:5}.brand{font-weight:900;font-size:1.25rem;display:flex;align-items:center;gap:10px}.brand-mark{display:inline-grid;place-items:center;width:38px;height:38px;border-radius:15px;background:rgba(103,232,249,.18);color:var(--brand);font-size:.9rem}.site-header nav{display:flex;gap:22px;color:var(--muted);font-weight:700}.hero{max-width:1180px;margin:0 auto;padding:76px 24px 42px;display:grid;grid-template-columns:1.15fr .85fr;gap:42px;align-items:center}.eyebrow{color:var(--brand);font-weight:900;text-transform:uppercase;letter-spacing:.08em;font-size:.8rem}.hero h1,.page-head h1{font-size:clamp(2.5rem,6vw,5.5rem);line-height:.96;margin:12px 0 22px;letter-spacing:-.06em}.hero-copy{font-size:1.15rem;line-height:1.8;color:var(--muted);max-width:690px}.actions{display:flex;gap:12px;flex-wrap:wrap;margin-top:28px}.actions.compact{margin-top:14px}.btn{display:inline-flex;border:0;border-radius:18px;padding:13px 20px;font-weight:900;cursor:pointer}.btn.primary{background:var(--brand);color:var(--dark)}.btn.secondary{background:rgba(255,255,255,.08);color:var(--text);border:1px solid var(--line)}.hero-card,.admin-card,.price-card,.tool-card,.prompt-card,.output-panel{background:rgba(255,255,255,.055);border:1px solid var(--line);border-radius:30px;padding:26px;box-shadow:0 18px 60px rgba(0,0,0,.22)}.hero-card ul{line-height:2;color:var(--muted);font-weight:700}.section{max-width:1180px;margin:0 auto;padding:48px 24px}.section.narrow-top{padding-top:12px}.section-head{margin-bottom:22px}.section-head h2,.banner h2{font-size:2.15rem;margin:0 0 8px}.section-head p,.banner p,.page-head p{color:var(--muted);line-height:1.7}.tool-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px}.tool-card{display:block;transition:.2s}.tool-card:hover{transform:translateY(-3px);border-color:rgba(103,232,249,.35)}.tool-card span,.tool-card small{color:var(--brand);font-size:.8rem;font-weight:900}.tool-card h3{font-size:1.25rem}.tool-card p{color:var(--muted);line-height:1.6}.banner{max-width:1180px;margin:24px auto;padding:36px;border-radius:34px;background:var(--brand);color:var(--dark)}.banner p{color:#164e63;font-weight:700}.pricing-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px}.price-card strong{display:block;font-size:2.4rem;margin:16px 0}.price-card p{color:var(--muted)}.price-card.featured{border-color:rgba(103,232,249,.45);background:rgba(103,232,249,.09)}.page-head{max-width:1180px;margin:0 auto;padding:54px 24px 22px}.page-head h1{font-size:clamp(2.2rem,5vw,4.5rem)}.tool-layout{max-width:1180px;margin:0 auto;padding:42px 24px;display:grid;grid-template-columns:1fr .85fr;gap:24px}.tool-main{background:rgba(255,255,255,.035);border:1px solid var(--line);border-radius:34px;padding:30px}.tool-main h1{font-size:2.65rem;margin:10px 0}.tool-main p{color:var(--muted);line-height:1.7}.generator-form,.prompt-card form{display:grid;gap:16px;margin-top:24px}label span{display:block;color:#d7e4f2;font-weight:800;margin-bottom:7px}input,textarea,select{width:100%;border:1px solid var(--line);background:#0b1728;color:var(--text);border-radius:17px;padding:13px 14px;font:inherit}textarea{min-height:110px;resize:vertical}.output-panel{position:sticky;top:96px;align-self:start}.output-panel pre{white-space:pre-wrap;background:white;color:#0f172a;border-radius:20px;padding:18px;line-height:1.6}.muted{color:var(--muted)}.paywall-note{margin-top:14px;color:#cffafe;background:rgba(103,232,249,.08);border:1px solid rgba(103,232,249,.18);border-radius:16px;padding:14px;line-height:1.5}.admin-grid{max-width:1180px;margin:0 auto;padding:30px 24px;display:grid;grid-template-columns:1fr 1fr;gap:20px}table{width:100%;border-collapse:collapse}th,td{text-align:left;border-bottom:1px solid var(--line);padding:12px;color:var(--muted)}th{color:var(--text)}td a{color:var(--brand);font-weight:900}.prompt-list{max-width:1180px;margin:0 auto;padding:24px;display:grid;gap:20px}.prompt-top{display:flex;justify-content:space-between;align-items:center}.prompt-top span{border-radius:999px;padding:6px 12px;background:rgba(255,255,255,.08);color:var(--brand);font-weight:900}.prompt-card.active{border-color:rgba(103,232,249,.5)}.site-footer{border-top:1px solid var(--line);padding:28px;text-align:center;color:var(--muted)}@media(max-width:850px){.site-header{padding:0 18px}.site-header nav{gap:12px;font-size:.9rem}.hero,.tool-layout,.admin-grid{grid-template-columns:1fr}.tool-grid,.pricing-grid{grid-template-columns:1fr}.output-panel{position:static}.hero{padding-top:44px}.hero h1{font-size:3rem}}

.tool-note {
  margin: 1rem 0 1.25rem;
  padding: 1rem;
  border: 1px solid rgba(31, 120, 180, 0.22);
  border-radius: 16px;
  background: rgba(31, 120, 180, 0.08);
  color: #203040;
  line-height: 1.5;
}

.field-help {
  display: block;
  margin-top: 0.35rem;
  color: #6b7280;
  font-size: 0.9rem;
  line-height: 1.4;
}

.tool-note {
  margin: 1rem 0 1.25rem;
  padding: 1rem;
  border: 1px solid rgba(103, 232, 249, 0.22);
  border-radius: 16px;
  background: rgba(103, 232, 249, 0.08);
  color: #d7f9ff;
  line-height: 1.5;
}

.field-help {
  display: block;
  margin-top: 0.35rem;
  color: #9fb0c4;
  font-size: 0.9rem;
  line-height: 1.4;
}

.success-note {
  margin-bottom: 14px;
  color: #bbf7d0;
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.22);
  border-radius: 16px;
  padding: 12px 14px;
  line-height: 1.5;
}

.phase2-note {
  margin: 0 0 16px;
  color: #cffafe;
  background: rgba(103, 232, 249, 0.08);
  border: 1px solid rgba(103, 232, 249, 0.2);
  border-radius: 16px;
  padding: 14px;
  line-height: 1.5;
}

.document-sections {
  display: grid;
  gap: 16px;
}

.doc-section {
  background: rgba(255,255,255,.055);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 16px;
}

.doc-section.is-revised {
  border-color: rgba(34, 197, 94, 0.35);
}

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

.doc-section-head h3 {
  margin: 0;
  font-size: 1.05rem;
}

.doc-section-head span {
  color: #bbf7d0;
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.22);
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 0.78rem;
  font-weight: 900;
}

.doc-section pre {
  margin: 0 0 12px;
  white-space: pre-wrap;
  background: white;
  color: #0f172a;
  border-radius: 16px;
  padding: 14px;
  line-height: 1.55;
}

.revision-form {
  display: grid;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.revision-form textarea {
  min-height: 76px;
}

.hidden-current-section {
  display: none;
}

.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.quick-actions .btn {
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 0.88rem;
}

.revision-history {
  margin-top: 16px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(255,255,255,.05);
  border: 1px solid var(--line);
}

.revision-history h3 {
  margin: 0 0 8px;
}

.revision-history ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.7;
}

.prompt-section-head {
  margin: 0 0 6px;
}

.prompt-section-head h2 {
  margin: 0 0 6px;
}

.prompt-section-head p {
  color: var(--muted);
  margin: 0;
  line-height: 1.55;
}

.prompt-test-result {
  max-width: 1180px;
  margin: 0 auto 18px;
  padding: 0 24px;
}

.prompt-test-result > h2 {
  margin: 0 0 12px;
}

.test-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.test-grid > div,
.test-panel {
  background: rgba(255,255,255,.055);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 16px;
}

.test-grid pre {
  white-space: pre-wrap;
  background: white;
  color: #0f172a;
  border-radius: 16px;
  padding: 14px;
  line-height: 1.55;
  max-height: 520px;
  overflow: auto;
}

.test-panel {
  margin-top: 14px;
}

.test-panel summary {
  cursor: pointer;
  font-weight: 900;
  color: var(--brand);
}

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

@media(max-width:850px){.test-grid{grid-template-columns:1fr}}

.plan-strip {
  margin: 1rem 0;
  padding: 0.85rem 1rem;
  border-radius: 16px;
  background: rgba(255,255,255,.06);
  border: 1px solid var(--line);
  color: #d7e4f2;
  line-height: 1.45;
}

.account-grid {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 18px;
}

.plan-pill {
  display: inline-flex;
  margin: 8px 0 12px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(103,232,249,.14);
  color: var(--brand);
  border: 1px solid rgba(103,232,249,.25);
  font-weight: 900;
}

.feature-list {
  color: var(--muted);
  line-height: 1.9;
  padding-left: 20px;
}

.document-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 14px;
}

.document-actions form {
  margin: 0;
}

.compact-note {
  margin: 0;
  padding: 10px 12px;
}

@media(max-width:850px){.account-grid{grid-template-columns:1fr}.document-actions{align-items:stretch}.document-actions .btn,.document-actions form,.document-actions button{width:100%;justify-content:center}}

.document-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 16px;
}

.compact-note {
  display: inline-flex;
  margin-top: 0;
}

.print-body {
  background: #e5e7eb;
  color: #111827;
  font-family: Georgia, 'Times New Roman', serif;
}

.print-toolbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  gap: 10px;
  justify-content: center;
  padding: 14px;
  background: #07111f;
  border-bottom: 1px solid rgba(255,255,255,.15);
}

.print-page {
  width: min(8.5in, calc(100% - 32px));
  min-height: 11in;
  margin: 24px auto;
  padding: .75in;
  background: #fff;
  color: #111827;
  box-shadow: 0 18px 60px rgba(0,0,0,.25);
}

.print-header {
  border-bottom: 2px solid #111827;
  margin-bottom: 24px;
  padding-bottom: 12px;
}

.print-header h1 {
  margin: 0 0 8px;
  font-size: 22pt;
  letter-spacing: 0;
}

.print-header p {
  margin: 0;
  color: #4b5563;
}

.print-section {
  margin: 18px 0;
  break-inside: avoid;
}

.print-section h2 {
  font-size: 13pt;
  margin: 0 0 8px;
  color: #111827;
  border-bottom: 1px solid #d1d5db;
  padding-bottom: 4px;
}

.print-text {
  white-space: pre-wrap;
  font-size: 11.5pt;
  line-height: 1.55;
}

@media print {
  body.print-body {
    background: #fff;
  }
  .no-print,
  .print-toolbar,
  .site-header,
  .site-footer {
    display: none !important;
  }
  .print-page {
    width: auto;
    min-height: auto;
    margin: 0;
    padding: 0;
    box-shadow: none;
  }
  @page {
    size: letter;
    margin: .65in;
  }
}


/* One-box communication engine additions */
.generator-form .one-box textarea {
  min-height: 220px;
  font-size: 1.02rem;
  line-height: 1.6;
  border-color: rgba(103,232,249,.35);
  box-shadow: 0 0 0 4px rgba(103,232,249,.06);
}

.advanced-fields {
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 12px;
  background: rgba(255,255,255,.04);
}

.advanced-fields summary {
  cursor: pointer;
  color: var(--brand);
  font-weight: 900;
  padding: 6px 4px;
}

.advanced-fields .form-field {
  margin-top: 14px;
}

.manual-edit-form {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.manual-edit-form textarea {
  min-height: 130px;
  background: #fff;
  color: #0f172a;
  border-color: rgba(15, 23, 42, 0.18);
}

.manual-edit-form .btn {
  justify-self: start;
}

.doc-section .revision-form {
  margin-top: 12px;
}

@media(max-width:850px){
  .generator-form .one-box textarea{min-height:180px}
}

/* Phase 2 company DOCX template branding */
.template-preview-card {
  margin: 8px 0 2px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255,255,255,.04);
}

.template-preview-card h3 {
  margin: 0 0 10px;
}

.logo-preview {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 220px;
  min-height: 88px;
  padding: 12px;
  border-radius: 18px;
  background: #fff;
}

.logo-preview img {
  max-width: 190px;
  max-height: 80px;
  object-fit: contain;
}

/* Phase 3 admin prompt cleanup */
.compact-page-head {
  padding-bottom: 10px;
}

.prompt-workspace {
  padding-top: 10px;
}

.prompt-two-column {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items: start;
}

.compact-prompt-card textarea {
  min-height: 86px;
  font-size: .92rem;
  line-height: 1.45;
}

.compact-prompt-card label:nth-of-type(2) textarea,
.compact-prompt-card label:nth-of-type(3) textarea {
  min-height: 130px;
}

.section-prompt-card {
  border-color: rgba(103,232,249,.38);
}

.workflow-test-card {
  border-color: rgba(103,232,249,.35);
  background: rgba(103,232,249,.07);
}

.prompt-test-row {
  display: grid;
  grid-template-columns: .8fr 1fr .8fr;
  gap: 14px;
}

.workflow-result-grid pre {
  max-height: 620px;
}

.prompt-debug-panel {
  margin-top: 18px;
}

.prompt-library-details {
  background: rgba(255,255,255,.035);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 16px;
}

.prompt-library-details > summary {
  cursor: pointer;
  font-size: 1.15rem;
  font-weight: 900;
  color: var(--brand);
}

.prompt-library-list {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}

@media(max-width:850px){
  .prompt-two-column,
  .prompt-test-row {
    grid-template-columns: 1fr;
  }
}

.section-title-row {
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  align-items: flex-start;
}

.profile-context-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 1rem;
  margin: 1rem 0;
}

.profile-context-box pre,
.learning-grid pre,
.learning-event pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin: 0;
  font-family: inherit;
  line-height: 1.5;
}

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

.learning-grid > div,
.learning-event {
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 1rem;
  background: #fff;
}

.learning-events {
  display: grid;
  gap: .75rem;
  margin-top: .75rem;
}

.learning-event small {
  display: block;
  color: #64748b;
  margin: .15rem 0 .5rem;
}

@media (max-width: 780px) {
  .section-title-row,
  .learning-grid {
    display: block;
  }
  .section-title-row form {
    margin-top: .75rem;
  }
  .learning-grid > div + div {
    margin-top: 1rem;
  }
}

/* Phase 5 template registry */
.template-list-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}
.template-list {
  display: grid;
  gap: .75rem;
}
.template-item {
  border: 1px solid rgba(15, 23, 42, .12);
  border-radius: 14px;
  padding: .85rem;
  background: #fff;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .75rem;
}
.template-item.is-disabled {
  opacity: .62;
}
.template-item small,
.template-item code {
  display: block;
  margin-top: .25rem;
  color: #64748b;
  word-break: break-all;
}
.template-actions {
  display: flex;
  gap: .4rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.checkline {
  display: flex !important;
  align-items: center;
  gap: .55rem;
}
.checkline input {
  width: auto;
}


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

.template-select {
  min-height: 38px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  border-radius: 10px;
  padding: 0.45rem 0.65rem;
  background: #fff;
  color: #111827;
  max-width: 280px;
}

.document-actions .inline-export-form,
.actions.compact .inline-export-form {
  margin: 0;
}


/* UI fixes: account readability, logo sizing, and run-detail overflow */
.tool-layout {
  grid-template-columns: minmax(0, 1fr) minmax(280px, .85fr);
  overflow-x: hidden;
}
.tool-main,
.output-panel,
.doc-section,
.actions.compact {
  min-width: 0;
}
.actions.compact {
  align-items: center;
}
.doc-section pre,
.tool-main > pre,
.output-panel pre {
  overflow-wrap: anywhere;
  word-break: break-word;
  max-width: 100%;
  overflow-x: auto;
}
.inline-export-form {
  max-width: 100%;
}
.inline-export-form .template-select {
  width: min(320px, 100%);
  max-width: 100%;
}
.profile-context-box,
.learning-grid > div,
.learning-event,
.template-item {
  background: rgba(255,255,255,.055);
  border-color: var(--line);
  color: var(--text);
}
.profile-context-box pre,
.learning-grid pre,
.learning-event pre {
  color: #dbeafe;
}
.learning-grid h3,
.learning-event strong,
.template-item strong {
  color: var(--text);
}
.template-item small,
.template-item code,
.learning-event small {
  color: var(--muted);
}
.template-actions .btn.secondary {
  white-space: nowrap;
}
.logo-preview {
  width: fit-content;
  max-width: min(260px, 100%);
  min-height: 96px;
}
.logo-preview img {
  display: block;
  width: auto;
  height: auto;
  max-width: 230px;
  max-height: 90px;
}
@media(max-width:850px){
  .tool-layout{grid-template-columns:1fr;overflow-x:hidden;}
  .actions.compact .btn,
  .actions.compact form,
  .actions.compact button,
  .actions.compact a,
  .actions.compact select{width:100%;justify-content:center;}
  .actions.compact .inline-export-form{display:grid;grid-template-columns:1fr;gap:10px;width:100%;}
}

/* Run detail: keep production-facing output clean; raw input data is intentionally hidden. */
.revisions-panel {
  align-self: start;
}
.revision-list {
  margin: 0;
  padding-left: 1.25rem;
}
.revision-list li + li {
  margin-top: 0.35rem;
}

/* Phase 9: one-box revision + document-type learning */
.quick-revision-card {
  margin: 14px 0 18px;
  padding: 18px;
  border: 1px solid rgba(99, 223, 255, .45);
  border-radius: 22px;
  background: rgba(99, 223, 255, .06);
}
.quick-revision-card h3 {
  margin-top: 0;
}
.quick-revision-card textarea {
  min-height: 110px;
  width: 100%;
  margin: 10px 0;
}
.precision-edit-panel {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 12px 14px;
  background: rgba(255,255,255,.035);
}
.precision-edit-panel summary {
  cursor: pointer;
  font-weight: 800;
  color: var(--text);
}
.precision-edit-panel[open] summary {
  margin-bottom: 12px;
}

/* Phase 10: full-document revision workspace + highlighted text targeting */
.revision-workspace {
  display: grid;
  gap: 18px;
  margin: 14px 0 18px;
}

.full-document-card {
  border: 1px solid rgba(148, 163, 184, .25);
  border-radius: 22px;
  background: rgba(255,255,255,.045);
  padding: 18px;
}

.full-document-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.full-document-head h3 {
  margin: 0;
}

.full-document-head span {
  color: var(--muted);
  font-size: .85rem;
  border: 1px solid rgba(148, 163, 184, .25);
  border-radius: 999px;
  padding: 6px 10px;
}

.selectable-document {
  user-select: text;
  -webkit-user-select: text;
  background: rgba(255,255,255,.96);
  color: #07111f;
  border-radius: 18px;
  padding: 22px;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, .08);
  max-height: 72vh;
  overflow: auto;
}

.selectable-document ::selection {
  background: rgba(99, 223, 255, .45);
  color: #07111f;
}

.doc-section-preview + .doc-section-preview {
  margin-top: 22px;
}

.doc-section-preview h4 {
  color: #0f172a;
  font-size: 1rem;
  margin: 0 0 10px;
  font-weight: 900;
}

.doc-section-preview pre {
  white-space: pre-wrap;
  margin: 0;
  color: #07111f;
  font-family: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;
  font-size: 1rem;
  line-height: 1.65;
  background: transparent;
  border: 0;
  padding: 0;
}

.selected-text-preview {
  border: 1px solid rgba(34, 197, 94, .35);
  background: rgba(34, 197, 94, .10);
  color: #bbf7d0;
  border-radius: 14px;
  padding: 10px 12px;
  font-size: .9rem;
  line-height: 1.45;
}

.selected-text-preview.is-empty {
  border-color: rgba(148, 163, 184, .22);
  background: rgba(148, 163, 184, .08);
  color: var(--muted);
}

.output-panel .revision-workspace,
.tool-main .revision-workspace {
  width: 100%;
}

@media (min-width: 1100px) {
  .tool-layout:has(.revision-workspace) {
    grid-template-columns: minmax(360px, 430px) minmax(620px, 1fr);
  }
}

@media (max-width: 850px) {
  .full-document-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .selectable-document {
    max-height: none;
    padding: 16px;
  }
}

/* Phase 11: clean run detail workspace + stable highlight targeting */
.run-detail-head {
  padding-bottom: 8px;
}

.run-detail-layout {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 24px 42px;
  display: grid;
  gap: 18px;
}

.run-control-bar {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, .85fr);
  gap: 18px;
  align-items: start;
}

.run-actions-card,
.run-revisions-card {
  background: rgba(255,255,255,.055);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 18px;
  box-shadow: 0 18px 60px rgba(0,0,0,.18);
  min-width: 0;
}

.run-actions-card .actions.compact {
  margin-top: 0;
}

.compact-success {
  margin: 0;
  display: inline-flex;
  align-items: center;
}

.run-revisions-card h2 {
  margin: 0 0 10px;
  font-size: 1.05rem;
}

.run-revision-workspace {
  gap: 18px;
}

.run-quick-revision-card {
  margin: 0;
}

.run-full-document-card {
  margin: 0;
  width: 100%;
  overflow: hidden;
}

.run-full-document-card .selectable-document {
  max-height: none;
  overflow: visible;
  width: 100%;
}

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

.selected-text-row .btn {
  white-space: nowrap;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
}

@media (max-width: 900px) {
  .run-control-bar {
    grid-template-columns: 1fr;
  }
  .selected-text-row {
    grid-template-columns: 1fr;
  }
  .selected-text-row .btn {
    width: 100%;
  }
}

/* History cleanup */
.history-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.history-summary-card {
  display: grid;
  gap: 4px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255,255,255,.055);
}
.history-summary-card span {
  color: var(--brand);
  font-size: .75rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.history-summary-card strong {
  font-size: 1.8rem;
}
.history-summary-card small {
  color: var(--muted);
  line-height: 1.35;
}
.history-filter-card,
.history-table-card {
  margin-top: 16px;
}
.history-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  gap: 12px;
  align-items: end;
}
.history-filter-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.history-table-head,
.pagination-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.history-table-head h2 {
  margin: 0;
}
.history-table-wrap {
  overflow-x: auto;
}
.history-table-wrap td strong,
.history-table-wrap td small {
  display: block;
}
.history-table-wrap td small {
  color: var(--muted);
  margin-top: 3px;
}
.history-pill {
  display: inline-flex;
  padding: 5px 9px;
  border-radius: 999px;
  border: 1px solid rgba(103,232,249,.22);
  background: rgba(103,232,249,.08);
  color: #cffafe;
  font-weight: 800;
  font-size: .82rem;
}
@media(max-width:900px){
  .history-filters{grid-template-columns:1fr}
  .history-filter-actions,.pagination-row,.history-table-head{align-items:stretch;flex-direction:column}
}

.link-button{background:none;border:0;color:inherit;font:inherit;cursor:pointer;padding:0;margin-left:1rem;}
.auth-card{max-width:520px;margin:4rem auto;padding:2rem;border:1px solid rgba(255,255,255,.16);border-radius:18px;background:rgba(255,255,255,.04);}
.auth-card label{display:block;margin:.9rem 0 .35rem;font-weight:700;}
.auth-card input{width:100%;padding:.85rem;border-radius:10px;border:1px solid rgba(255,255,255,.2);background:#091727;color:#fff;}
.auth-error{padding:.75rem 1rem;border-radius:10px;background:rgba(255,80,80,.12);border:1px solid rgba(255,80,80,.35);margin-bottom:1rem;}

/* Phase 3 company account admin */
.grid-2,
.grid-3 {
  display: grid;
  gap: 12px;
}
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
@media(max-width:900px){
  .grid-2,
  .grid-3 { grid-template-columns: 1fr; }
}

/* Email action buttons in generated output/history */
.history-actions-cell {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.history-actions-cell a,
.history-actions-cell .link-button {
  margin-left: 0;
  color: #67e8f9;
  font-weight: 800;
  text-decoration: none;
}
.history-actions-cell a:hover,
.history-actions-cell .link-button:hover {
  text-decoration: underline;
}

/* App-level form/action errors */
.app-alert{display:flex;gap:14px;align-items:flex-start;margin:18px 0;padding:16px 18px;border-radius:18px;line-height:1.5}
.app-alert.compact{margin:8px 0 14px}
.app-alert-error{background:rgba(248,113,113,.11);border:1px solid rgba(248,113,113,.38);color:#fee2e2}
.app-alert-icon{flex:0 0 28px;width:28px;height:28px;border-radius:999px;display:grid;place-items:center;background:rgba(248,113,113,.22);border:1px solid rgba(248,113,113,.42);font-weight:900;color:#fecaca}
.app-alert-body strong{display:block;color:#fff;margin-bottom:4px}
.app-alert-body p{margin:0;color:#fecaca!important}
.app-alert-actions{display:flex;gap:12px;align-items:center;flex-wrap:wrap;margin-top:12px}
.app-alert-actions .btn{padding:10px 14px;border-radius:14px}

/* Responsive navigation and logged-in dashboard polish */
.site-header nav.site-nav {
  display: flex;
  align-items: center;
  gap: 22px;
}
.site-nav form { margin: 0; }
.link-button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
}
.link-button:hover,
.site-nav a:hover { color: var(--text); }
.nav-cta {
  color: var(--dark) !important;
  background: var(--brand);
  border-radius: 999px;
  padding: 9px 14px;
}
.mobile-menu-toggle {
  display: none;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,.07);
  color: var(--text);
  font-weight: 900;
  padding: 10px 13px;
}
.quick-proof {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}
.quick-proof span {
  border: 1px solid rgba(103,232,249,.25);
  background: rgba(103,232,249,.09);
  color: #cffafe;
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 800;
  font-size: .92rem;
}
.center-head { text-align: center; max-width: 860px; margin-left: auto; margin-right: auto; }
.value-grid,
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.value-grid .admin-card p,
.dashboard-status p { color: var(--muted); line-height: 1.65; }
.public-banner { background: rgba(103,232,249,.12); color: var(--text); border: 1px solid rgba(103,232,249,.25); }
.public-banner p { color: #cffafe; }
.dashboard-grid { grid-template-columns: .8fr 1.2fr; }
.dashboard-head h1 { max-width: 900px; }

@media(max-width:850px){
  .site-header {
    height: auto;
    min-height: 68px;
    align-items: center;
    flex-wrap: wrap;
    padding: 14px 18px;
  }
  .mobile-menu-toggle { display: inline-flex; margin-left: auto; }
  .site-header nav.site-nav {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding-top: 14px;
  }
  .site-header nav.site-nav.is-open { display: flex; }
  .site-nav a,
  .site-nav .link-button,
  .site-nav form {
    display: block;
    width: 100%;
    text-align: left;
  }
  .site-nav a,
  .site-nav .link-button {
    padding: 13px 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255,255,255,.045);
  }
  .nav-cta { text-align: center !important; }
  .public-hero { padding-top: 38px; }
  .value-grid,
  .dashboard-grid { grid-template-columns: 1fr; }
}

/* Public homepage polish */
.compact-hero {
  padding-top: 64px;
  align-items: center;
}

.compact-hero h1 {
  font-size: clamp(2.4rem, 4.8vw, 4.8rem);
  line-height: 1.02;
  max-width: 760px;
}

.quick-proof {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.quick-proof span {
  display: inline-flex;
  border: 1px solid rgba(103,232,249,.28);
  color: #cffafe;
  background: rgba(103,232,249,.08);
  border-radius: 999px;
  padding: 7px 10px;
  font-size: .82rem;
  font-weight: 900;
}

.center-head {
  text-align: center;
  max-width: 780px;
  margin-left: auto;
  margin-right: auto;
}

.value-grid,
.step-grid,
.example-grid,
.split-section {
  display: grid;
  gap: 18px;
}

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

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

.step-card span {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 14px;
  background: rgba(103,232,249,.16);
  color: var(--brand);
  font-weight: 900;
  margin-bottom: 10px;
}

.step-card p,
.value-grid p,
.example-card p,
.emphasis-card p {
  color: var(--muted);
  line-height: 1.65;
}

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

.example-card {
  background: rgba(255,255,255,.055);
  border: 1px solid var(--line);
  border-radius: 30px;
  padding: 26px;
}

.example-card h3 {
  margin-top: 0;
}

.input-example {
  border-color: rgba(255,255,255,.15);
}

.output-example {
  border-color: rgba(103,232,249,.35);
  background: rgba(103,232,249,.08);
}

.split-section {
  grid-template-columns: 1fr 1fr;
}

.emphasis-card h2 {
  margin-top: 0;
  font-size: 1.7rem;
}

.final-cta .btn.secondary {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.18);
  color: #f8fafc;
}

.final-cta .btn.primary {
  background: #07111f;
  color: #f7fbff;
}

@media(max-width:850px){
  .compact-hero h1{font-size:2.65rem;letter-spacing:-.04em}
  .value-grid,.step-grid,.example-grid,.split-section{grid-template-columns:1fr}
  .center-head{text-align:left}
}

/* Dashboard workflow-first layout */
.dashboard-start { padding-bottom: 10px; }
.dashboard-start-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-color: rgba(103,232,249,.28);
  background: rgba(103,232,249,.075);
}
.dashboard-start-card h2 { margin: 4px 0 8px; font-size: 1.65rem; }
.dashboard-start-card .btn { flex: 0 0 auto; }
.dashboard-tool-grid .tool-card:first-child {
  border-color: rgba(103,232,249,.38);
  background: rgba(103,232,249,.07);
}
.dashboard-account-grid { grid-template-columns: 1fr 1fr; padding-top: 6px; }
.table-wrap { width: 100%; overflow-x: auto; }
.recent-work-card table { min-width: 720px; }
@media(max-width:850px){
  .dashboard-start-card { align-items: flex-start; flex-direction: column; }
  .dashboard-account-grid { grid-template-columns: 1fr; }
  .recent-work-card table { min-width: 640px; }
}

/* Cleaner document editor/refinement flow */
.run-actions-card .actions.compact {
  gap: 10px;
  align-items: center;
}
.run-actions-card .btn.primary {
  box-shadow: 0 0 0 1px rgba(103,232,249,.22), 0 12px 30px rgba(103,232,249,.12);
}
.quick-revision-card {
  border-color: rgba(103,232,249,.32);
  background: linear-gradient(180deg, rgba(103,232,249,.09), rgba(255,255,255,.045));
}
.quick-revision-card h3 {
  font-size: 1.15rem;
}
.quick-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 12px;
}
.quick-action-row .btn {
  padding: 10px 13px;
  border-radius: 14px;
  font-size: .88rem;
}
.selection-revision-form textarea[name="quick_instruction"] {
  min-height: 86px;
  margin-top: 10px;
  border-color: rgba(103,232,249,.25);
}
.selection-revision-form .btn.primary[type="submit"] {
  margin-top: 4px;
}
.full-document-card {
  border-color: rgba(103,232,249,.18);
}
.selectable-document {
  cursor: text;
}
.doc-section-preview {
  border-radius: 12px;
  padding: 10px 12px;
  margin-left: -12px;
  margin-right: -12px;
  transition: background .15s ease, box-shadow .15s ease;
}
.doc-section-preview:hover {
  background: rgba(14,116,144,.08);
  box-shadow: inset 3px 0 0 rgba(103,232,249,.75);
}
.selected-text-preview:not(.is-empty) {
  border-color: rgba(103,232,249,.45);
  background: rgba(103,232,249,.12);
  color: #d7f9ff;
}
@media(max-width:850px){
  .quick-action-row .btn{width:100%;justify-content:center}
}

/* Friendly form-error states */
.limit-card,
.error-card {
  margin-top: 14px;
  padding: 18px 20px;
  border-radius: 18px;
  line-height: 1.55;
}
.limit-card {
  background: rgba(251, 191, 36, 0.10);
  border: 1px solid rgba(251, 191, 36, 0.36);
}
.limit-card h3 {
  margin: 0 0 8px;
  color: #fde68a;
}
.limit-card p {
  margin: 6px 0;
}
.edit-counter {
  display: inline-flex;
  margin-top: 10px;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  color: var(--text);
  font-weight: 800;
  font-size: .9rem;
}
.error-card {
  background: rgba(248, 113, 113, 0.10);
  border: 1px solid rgba(248, 113, 113, 0.36);
}
.error-card h3 {
  margin: 0 0 8px;
  color: #fecaca;
}
.btn.danger { background: #7f1d1d; color: #fff; border-color: #991b1b; }
.btn.disabled, .btn.disabled:hover { opacity: .65; pointer-events: none; cursor: default; }
.success-note { border: 1px solid rgba(34,197,94,.35); background: rgba(34,197,94,.08); padding: .85rem 1rem; border-radius: 12px; margin: .75rem 0; }
.button-row { display: flex; gap: .75rem; flex-wrap: wrap; align-items: center; margin-top: 1rem; }
.check-row { display: flex; gap: .5rem; align-items: center; margin: .35rem 0; }
code { background: rgba(148,163,184,.12); padding: .1rem .35rem; border-radius: .35rem; }


/* History delete confirmation */
.delete-document-form {
  display: inline;
  margin: 0;
}
.history-actions-cell .danger-link {
  color: #fca5a5;
}
.history-actions-cell .danger-link:hover {
  color: #fecaca;
}
.confirm-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(2, 6, 23, .76);
  backdrop-filter: blur(6px);
}
.confirm-modal-backdrop[hidden] {
  display: none;
}
.confirm-modal {
  width: min(460px, 100%);
  padding: 24px;
  border-radius: 24px;
  border: 1px solid rgba(248, 113, 113, .38);
  background: #111827;
  box-shadow: 0 24px 80px rgba(0,0,0,.45);
}
.confirm-modal h3 {
  margin: 0 0 10px;
}
.confirm-modal p {
  color: var(--muted);
  line-height: 1.55;
  margin: 0;
}
.confirm-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
  flex-wrap: wrap;
}
.btn.danger {
  border: 1px solid rgba(248,113,113,.45);
  background: rgba(248,113,113,.16);
  color: #fee2e2;
}
.btn.danger:hover {
  background: rgba(248,113,113,.26);
}


.footer-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 10px;
}
.footer-links a { color: inherit; text-decoration: none; opacity: 0.9; }
.footer-links a:hover { text-decoration: underline; }
.legal-head { text-align: center; }
.legal-layout { max-width: 920px; margin-left: auto; margin-right: auto; }
.legal-card, .contact-card {
  background: rgba(255,255,255,0.98);
  color: #0f172a;
  border: 1px solid rgba(15,23,42,0.08);
  border-radius: 22px;
  padding: 34px;
  box-shadow: 0 18px 45px rgba(15,23,42,0.08);
}
.legal-content { font-size: 1rem; }
.legal-content h2 {
  color: #0f172a;
  font-size: 1.35rem;
  line-height: 1.25;
  margin: 1.9rem 0 .75rem;
  letter-spacing: -.02em;
}
.legal-content h3 {
  color: #1e293b;
  font-size: 1.05rem;
  line-height: 1.35;
  margin: 1.2rem 0 .45rem;
}
.legal-card p {
  color: #334155;
  line-height: 1.75;
  margin: 0 0 .95rem;
  white-space: normal;
}
.legal-bullet {
  position: relative;
  padding-left: 1.35rem;
  margin-bottom: .45rem !important;
}
.legal-bullet::before {
  content: "•";
  position: absolute;
  left: .2rem;
  color: #0e7490;
  font-weight: 900;
}
.legal-spacer { height: .35rem; }
.stacked-form { display: grid; gap: 16px; }
.stacked-form label { display: grid; gap: 6px; font-weight: 700; }
.stacked-form input, .stacked-form textarea, .stacked-form select,
.inline-admin-form input, .inline-admin-form textarea, .inline-admin-form select {
  width: 100%;
  border: 1px solid rgba(15,23,42,0.16);
  border-radius: 12px;
  padding: 11px 12px;
  font: inherit;
  background: #fff;
}
.stacked-form textarea, .inline-admin-form textarea { min-height: 110px; resize: vertical; }
.hp-field { position: absolute; left: -10000px; height: 1px; overflow: hidden; }
.single-column { grid-template-columns: 1fr !important; }
.check-row { display: flex !important; align-items: center; gap: 10px; }
.check-row input { width: auto; }
.message-card { border-top: 1px solid rgba(15,23,42,0.1); padding: 20px 0; }
.message-card:first-child { border-top: 0; padding-top: 0; }
.message-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.message-card pre { white-space: pre-wrap; background: rgba(15,23,42,0.04); padding: 14px; border-radius: 12px; }
.status-pill { display: inline-flex; border-radius: 999px; padding: 5px 10px; background: rgba(15,23,42,0.08); font-size: 0.85rem; text-transform: capitalize; }
.inline-admin-form { display: grid; gap: 12px; margin-top: 14px; }
.inline-admin-form label { display: grid; gap: 6px; font-weight: 700; }

/* Contact page: match WorkDrafts dark glass site style */
.contact-card {
  background: rgba(255,255,255,.055);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 30px;
  padding: 34px;
  box-shadow: 0 18px 60px rgba(0,0,0,.22);
}

.contact-card .stacked-form {
  gap: 18px;
}

.contact-card .stacked-form label {
  color: var(--text);
  font-weight: 800;
}

.contact-card .stacked-form label span {
  color: #d7e4f2;
  font-weight: 900;
  margin-bottom: 2px;
}

.contact-card .stacked-form input,
.contact-card .stacked-form textarea,
.contact-card .stacked-form select {
  background: #0b1728;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 17px;
  padding: 13px 14px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.03);
}

.contact-card .stacked-form input::placeholder,
.contact-card .stacked-form textarea::placeholder {
  color: #9fb0c4;
  opacity: .82;
}

.contact-card .stacked-form input:focus,
.contact-card .stacked-form textarea:focus,
.contact-card .stacked-form select:focus {
  outline: none;
  border-color: rgba(103,232,249,.65);
  box-shadow: 0 0 0 4px rgba(103,232,249,.12);
}

.contact-card .btn.primary {
  justify-content: center;
  width: 100%;
  border-radius: 18px;
  padding: 15px 20px;
  box-shadow: 0 12px 28px rgba(103,232,249,.14);
}

.contact-card .success-note {
  color: #bbf7d0;
  background: rgba(34,197,94,.1);
  border: 1px solid rgba(34,197,94,.22);
}

.contact-card .limit-card,
.contact-card .error-card {
  background: rgba(248,113,113,.1);
  border: 1px solid rgba(248,113,113,.25);
  color: #fecaca;
}

@media(max-width:850px){
  .legal-layout { padding-top: 24px; }
  .contact-card { padding: 22px; border-radius: 24px; }
}

/* Admin legal page editor: match dark WorkDrafts admin UI */
.admin-card .stacked-form label,
.admin-card .inline-admin-form label {
  color: var(--text);
  font-weight: 800;
}

.admin-card .stacked-form label span,
.admin-card .inline-admin-form label span {
  color: #d7e4f2;
  font-weight: 900;
}

.admin-card .stacked-form input,
.admin-card .stacked-form textarea,
.admin-card .stacked-form select,
.admin-card .inline-admin-form input,
.admin-card .inline-admin-form textarea,
.admin-card .inline-admin-form select {
  background: #0b1728;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 17px;
  padding: 13px 14px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.03);
}

.admin-card .stacked-form input::placeholder,
.admin-card .stacked-form textarea::placeholder,
.admin-card .inline-admin-form input::placeholder,
.admin-card .inline-admin-form textarea::placeholder {
  color: #9fb0c4;
  opacity: .82;
}

.admin-card .stacked-form input:focus,
.admin-card .stacked-form textarea:focus,
.admin-card .stacked-form select:focus,
.admin-card .inline-admin-form input:focus,
.admin-card .inline-admin-form textarea:focus,
.admin-card .inline-admin-form select:focus {
  outline: none;
  border-color: rgba(103,232,249,.65);
  box-shadow: 0 0 0 4px rgba(103,232,249,.12);
}

.admin-card .stacked-form textarea,
.admin-card .inline-admin-form textarea {
  min-height: 260px;
  line-height: 1.65;
}

.admin-card .check-row {
  color: #d7e4f2;
}

.admin-card .check-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--brand);
}


/* WorkDrafts header/logo refresh */
.brand{gap:12px;font-weight:900;letter-spacing:-.03em;}
.brand-logo{width:46px;height:46px;border-radius:16px;display:block;object-fit:cover;box-shadow:0 0 0 1px rgba(255,255,255,.12),0 10px 28px rgba(0,180,255,.18);}
.brand-name{font-size:1.38rem;line-height:1;color:#fff;text-shadow:0 1px 12px rgba(103,232,249,.10);}
.brand-mark{display:none!important;}
@media(max-width:850px){.brand-logo{width:42px;height:42px;border-radius:14px}.brand-name{font-size:1.15rem}}
