:root {
      --dark: #2c1a42; --accent: #6423a6; --grey: #4b5563; --line: #d3c5e6; --field-bg: #f6f2fb;
    }
    .forms-plugin, .forms-plugin * { box-sizing: border-box; }
.forms-plugin {
      font-family: -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
      color: var(--dark);
      background: #ece3f7;
      margin: 0;
      padding: 0 0 60px 0;
    }
    .toolbar {
      position: sticky; top: 0; z-index: 50;
      background: var(--dark); color: #fff;
      padding: 12px 18px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
      box-shadow: 0 2px 8px rgba(0,0,0,.25);
    }
    .toolbar .title { font-weight: 700; font-size: 14px; margin-right: auto; }
    .toolbar button, .toolbar label.filebtn {
      background: var(--accent); color: #fff; border: none; border-radius: 6px;
      padding: 8px 14px; font-size: 13px; font-weight: 600; cursor: pointer;
    }
    .toolbar button.secondary, .toolbar label.filebtn {
      background: transparent; border: 1px solid #b79ddb; color: #eee2fb;
    }
    .toolbar input[type=file] { display: none; }
    .toolbar .hint { font-size: 11.5px; color: #cbb8ea; width: 100%; margin-top: -2px; }
    .page {
      width: calc(100% - 40px);
      max-width: 1200px;
      margin: 26px auto;
      background: #fff;
      box-shadow: 0 2px 18px rgba(44,26,66,.18);
      border-radius: 4px;
      overflow-x: hidden;
      overflow-y: visible;
    }
    .headerband { height: 8px; background: var(--accent); }
    .header {
      display: flex; justify-content: space-between; align-items: baseline;
      padding: 8px 40px 10px 40px; border-bottom: 1px solid var(--line);
      font-size: 11px; color: var(--grey);
    }
    .titleblock { padding: 18px 40px 6px 40px; }
    .titleblock h1 { font-size: 19px; margin: 0 0 4px 0; color: var(--dark); }
    .titleblock h2 { font-size: 15px; margin: 0; color: var(--accent); font-weight: 700; }
    .intro { padding: 6px 40px 4px 40px; font-size: 12.6px; line-height: 1.55; color: var(--dark); }
    .section-title {
      background: var(--accent); color: #fff; font-weight: 700; font-size: 14px;
      margin: 22px 40px 10px 40px; padding: 9px 12px; border-radius: 3px;
    }
    .section-note { padding: 0 40px 6px 40px; font-size: 11.5px; color: var(--grey); line-height: 1.5; }
    .qblock { padding: 0 40px 14px 40px; }
    .qlabel { font-weight: 700; font-size: 12.6px; color: var(--dark); margin-bottom: 4px; }
    .qnum { color: var(--accent); }
    .qnote { font-size: 10.8px; color: var(--grey); margin: 2px 0 6px 0; font-style: italic; }
    textarea.autogrow, input.field {
      width: 100%; background: var(--field-bg); border: 1px solid var(--line); border-radius: 3px;
      padding: 8px 9px; font-family: inherit; font-size: 12.2px; color: #111;
      resize: vertical; overflow: auto; line-height: 1.4;
    }
    textarea.autogrow {
      min-height: 5.5em;
      resize: vertical !important;
      overflow: auto !important;
      max-height: none;
    }
    /* Single-line answer controls cannot have a native resize handle, so make
       them comfortably larger by default. */
    input.field, select.field {
      min-height: 42px;
      font-size: 13px;
    }
    /* Make the browser's resize corner easier to discover. */
    textarea.autogrow:hover,
    textarea.autogrow:focus {
      resize: vertical !important;
    }
    input.field { height: 30px; }
    textarea.autogrow:focus, input.field:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
    table.fillable { width: calc(100% - 80px); margin: 0 40px 18px 40px; border-collapse: collapse; }
    table.fillable th {
      background: var(--dark); color: #fff; font-size: 10.6px; text-align: left;
      padding: 7px 8px; font-weight: 700;
    }
    table.fillable td {
      border: 1px solid var(--line); padding: 6px 7px; vertical-align: top; font-size: 11.6px;
    }
    table.fillable td.rowlabel { background: #fbf9fd; color: var(--dark); font-weight: 600; width: 26%; }
    table.fillable td textarea.autogrow { min-height: 5em; padding: 7px 8px; font-size: 11.4px; resize: vertical !important; overflow: auto !important; }
    table.fillable td select.field { width: 100%; padding: 5px; border: 1px solid var(--line); border-radius: 3px; background: var(--field-bg); font-size: 11.4px; }
    .twocol { display: flex; align-items: center; margin: 0 40px 10px 40px; gap: 12px; }
    .twocol .lbl { width: 40%; font-size: 12.4px; color: var(--dark); }
    .twocol input.field { flex: 1; }
    .secf-head { padding: 14px 40px 0 40px; }
    .secf-head .h { font-weight: 700; font-size: 12.6px; color: var(--accent); }
    .secf-head .ref { font-size: 10.6px; font-style: italic; color: var(--grey); margin: 2px 0 6px 0; }
    .footer-note { padding: 18px 40px 24px 40px; font-size: 10.6px; color: var(--grey); border-top: 1px solid var(--line); margin-top: 20px; }
    @media print {
      .forms-plugin { background: #fff; }
      .toolbar { display: none !important; }
      .page { box-shadow: none; margin: 0; max-width: 100%; border-radius: 0; }
      .section-title, .headerband, table.fillable th {
        -webkit-print-color-adjust: exact; print-color-adjust: exact;
      }
      .qblock, table.fillable tr, .twocol { break-inside: avoid; }
      .section-title { break-after: avoid; }
    }
    @page { margin: 14mm; }

/* WordPress wrapper */
.forms-plugin {
  color: var(--dark);
  background: #ece3f7;
  padding: 1px 0 60px;
  min-height: 100vh;
}
.forms-plugin .toolbar button:disabled { opacity: .6; cursor: not-allowed; }



/* WordPress save status */
.save-status {
  font-size: 12px;
  font-weight: 600;
  color: #ffffff;
  padding: 4px 8px;
  min-height: 1em;
}

/* Completed forms remain editable; the status badge indicates submission state. */

.forms-plugin button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Forms portal additions */
.forms-dashboard-link {
  color: #fff;
  text-decoration: none;
  border: 1px solid #b79ddb;
  border-radius: 6px;
  padding: 7px 11px;
  font-size: 12px;
  font-weight: 600;
}
.forms-dashboard-link:hover { background: rgba(255,255,255,.08); }

.forms-share-panel {
  max-width: 900px;
  margin: 18px auto 0;
  background: #fff;
  border: 1px solid var(--line);
  border-left: 5px solid var(--accent);
  border-radius: 6px;
  padding: 14px 16px;
  box-shadow: 0 2px 12px rgba(44,26,66,.10);
}
.forms-share-panel p { margin: 5px 0 10px; font-size: 13px; color: var(--grey); }
.forms-share-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.forms-share-row input {
  flex: 1;
  min-width: 260px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
  font-size: 14px;
}
.forms-share-row button,
.forms-primary-button,
.forms-secondary-button {
  display: inline-block;
  border: 0;
  border-radius: 6px;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}
.forms-share-row button,
.forms-primary-button { background: var(--accent); color: #fff; }
.forms-secondary-button { background: #fff; color: var(--dark); border: 1px solid var(--line); }
.forms-share-status { margin-top: 9px; font-size: 12px; font-weight: 600; }

.forms-dashboard { max-width: 920px; margin: 35px auto; padding: 0 18px; }
.forms-dashboard-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 20px; }
.forms-dashboard-head h2 { margin: 0 0 4px; color: var(--dark); }
.forms-dashboard-head p { margin: 0; color: var(--grey); }
.forms-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.forms-card { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 18px; box-shadow: 0 2px 12px rgba(44,26,66,.08); }
.forms-card h3 { margin: 0 0 10px; color: var(--dark); }
.forms-card-meta { color: var(--grey); font-size: 12px; min-height: 18px; }
.forms-status { display: inline-block; padding: 4px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; background: #f3f4f6; }
.forms-status-draft { background: #fff6d8; }
.forms-status-completed { background: #e7f7ea; }

.forms-login-box { max-width: 430px; margin: 50px auto; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 24px; box-shadow: 0 2px 14px rgba(44,26,66,.10); }
.forms-login-box h2 { margin-top: 0; color: var(--dark); }
.forms-login-box label { display: block; font-weight: 600; margin-bottom: 4px; }
.forms-login-box input[type="text"],
.forms-login-box input[type="password"] { width: 100%; padding: 10px; border: 1px solid var(--line); border-radius: 5px; }
.forms-login-box .login-submit input { background: var(--accent); color: #fff; border: 0; border-radius: 6px; padding: 10px 15px; font-weight: 700; cursor: pointer; }
.forms-login-help { margin-bottom: 0; }



@media (max-width: 650px) {
  .forms-dashboard-head { align-items: flex-start; flex-direction: column; }
  .forms-share-row { align-items: stretch; flex-direction: column; }
  .forms-share-row input { min-width: 0; width: 100%; }
}

@media print {
  .forms-share-panel,
  .forms-dashboard-link { display: none !important; }
}


/* Ensure long forms can always scroll vertically, even inside restrictive WP themes */
html.forms-page-scroll-fix,
body.forms-page-scroll-fix {
  height: auto !important;
  min-height: 100% !important;
  max-height: none !important;
  overflow-y: auto !important;
  overflow-x: hidden;
}

.forms-plugin {
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
  position: relative;
}

.forms-plugin .page {
  height: auto !important;
  max-height: none !important;
}


/* v2.2: Allow the form to use a wider content area inside WordPress themes */
.forms-plugin {
  width: 100% !important;
  max-width: none !important;
}

.entry-content:has(.forms-plugin),
.wp-block-post-content:has(.forms-plugin),
.site-main:has(.forms-plugin) {
  max-width: none !important;
  width: 100% !important;
}

@media (max-width: 768px) {
  .forms-plugin .page {
    width: calc(100% - 16px);
    margin: 8px auto;
  }
}

/* v2.4 sticky toolbar action groups */
.forms-plugin .toolbar {
  position: sticky !important;
  top: 0 !important;
  z-index: 9999 !important;
  width: 100%;
}

.forms-plugin .toolbar .title {
  flex: 0 0 auto;
  margin-right: 14px;
  white-space: nowrap;
}

.forms-plugin .toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.forms-plugin .toolbar-form-actions {
  flex: 1 1 auto;
}

.forms-plugin .toolbar-account-actions {
  flex: 0 0 auto;
  margin-left: 12px;
  padding-left: 16px;
  border-left: 1px solid rgba(255,255,255,.35);
}

.forms-plugin .toolbar-account-actions .forms-dashboard-link {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 12px;
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 6px;
  color: #fff !important;
  text-decoration: none !important;
  font-size: 13px;
  font-weight: 600;
  background: rgba(255,255,255,.07);
}

.forms-plugin .toolbar-account-actions .forms-dashboard-link:hover,
.forms-plugin .toolbar-account-actions .forms-dashboard-link:focus {
  background: rgba(255,255,255,.16);
  color: #fff !important;
}

@media (max-width: 900px) {
  .forms-plugin .toolbar .title {
    width: 100%;
  }
  .forms-plugin .toolbar-form-actions {
    width: 100%;
  }
  .forms-plugin .toolbar-account-actions {
    width: 100%;
    margin-left: 0;
    padding-left: 0;
    padding-top: 8px;
    border-left: 0;
    border-top: 1px solid rgba(255,255,255,.25);
  }
}

/* v2.5 — fixed bottom toolbar */
.forms-plugin {
  padding-bottom: 150px !important;
}

.forms-plugin .toolbar {
  position: fixed !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  top: auto !important;
  z-index: 99999 !important;
  width: 100% !important;
  margin: 0 !important;
  border-radius: 0 !important;
  box-shadow: 0 -3px 14px rgba(0,0,0,.28) !important;
  display: grid !important;
  grid-template-columns: minmax(180px, auto) 1fr auto;
  align-items: center;
  gap: 12px 18px;
  padding: 10px 18px !important;
}

.forms-plugin .toolbar .title {
  margin: 0 !important;
  white-space: nowrap;
}

.forms-plugin .toolbar-form-actions,
.forms-plugin .toolbar-account-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.forms-plugin .toolbar-form-actions {
  justify-content: flex-start;
}

.forms-plugin .toolbar-account-actions {
  justify-content: flex-end;
  padding-left: 18px;
  border-left: 1px solid rgba(255,255,255,.28);
}

.forms-plugin .forms-dashboard-link {
  color: #fff !important;
  text-decoration: none !important;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 10px;
  border: 1px solid rgba(255,255,255,.45);
  border-radius: 6px;
  white-space: nowrap;
}

.forms-plugin .forms-dashboard-link:hover,
.forms-plugin .forms-dashboard-link:focus {
  background: rgba(255,255,255,.12);
}

.forms-plugin .toolbar .hint {
  grid-column: 1 / -1;
  width: 100%;
  margin: -2px 0 0 !important;
  line-height: 1.25;
}

/* Keep the share panel and final form content above the fixed bar. */
.forms-plugin .page,
.forms-plugin .forms-share-panel {
  position: relative;
  z-index: 1;
}

@media (max-width: 900px) {
  .forms-plugin {
    padding-bottom: 220px !important;
  }

  .forms-plugin .toolbar {
    grid-template-columns: 1fr;
    gap: 8px;
    max-height: 45vh;
    overflow-y: auto;
  }

  .forms-plugin .toolbar .title {
    white-space: normal;
  }

  .forms-plugin .toolbar-account-actions {
    justify-content: flex-start;
    padding-left: 0;
    padding-top: 8px;
    border-left: 0;
    border-top: 1px solid rgba(255,255,255,.28);
  }

  .forms-plugin .toolbar .hint {
    grid-column: auto;
  }
}

@media print {
  .forms-plugin {
    padding-bottom: 0 !important;
  }
  .forms-plugin .toolbar {
    display: none !important;
  }
}


/* v2.7 — top sticky toolbar + repeated actions at end of form */
.forms-plugin {
  padding-bottom: 0 !important;
}

.forms-plugin .toolbar {
  position: sticky !important;
  position: -webkit-sticky !important;
  top: 0 !important;
  bottom: auto !important;
  left: auto !important;
  right: auto !important;
  z-index: 99999 !important;
  width: 100% !important;
  margin: 0 !important;
  border-radius: 0 !important;
  box-shadow: 0 3px 14px rgba(0,0,0,.22) !important;
  display: grid !important;
  grid-template-columns: minmax(180px, auto) 1fr auto;
  align-items: center;
  gap: 12px 18px;
  padding: 10px 18px !important;
  overflow: visible !important;
  max-height: none !important;
}

.forms-plugin .toolbar-account-actions {
  justify-content: flex-end;
  padding-left: 18px;
  border-left: 1px solid rgba(255,255,255,.28);
}

.forms-plugin .forms-end-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  margin: 22px 40px 28px;
  padding: 16px;
  background: #f6f2fb;
  border: 1px solid #d3c5e6;
  border-radius: 6px;
}

.forms-plugin .forms-end-actions button {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.forms-plugin .forms-end-actions button.secondary {
  background: var(--dark);
}

.forms-plugin .forms-end-actions button:disabled {
  opacity: .6;
  cursor: not-allowed;
}

@media (max-width: 900px) {
  .forms-plugin {
    padding-bottom: 0 !important;
  }

  .forms-plugin .toolbar {
    grid-template-columns: 1fr !important;
    gap: 8px;
    max-height: none !important;
    overflow: visible !important;
  }

  .forms-plugin .toolbar-account-actions {
    justify-content: flex-start;
    padding-left: 0;
    padding-top: 8px;
    border-left: 0;
    border-top: 1px solid rgba(255,255,255,.28);
  }

  .forms-plugin .forms-end-actions {
    margin: 18px 8px 22px;
    justify-content: stretch;
  }

  .forms-plugin .forms-end-actions button {
    flex: 1 1 100%;
    width: 100%;
  }
}

@media print {
  .forms-plugin .toolbar,
  .forms-plugin .forms-end-actions {
    display: none !important;
  }
}

/* v2.8 — true fixed toolbar at top */
.forms-plugin {
  position: relative;
}

.forms-plugin .toolbar {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: auto !important;
  width: 100% !important;
  z-index: 999999 !important;
  margin: 0 !important;
  border-radius: 0 !important;
}

@media print {
  .forms-plugin {
    padding-top: 0 !important;
  }
  .forms-plugin .toolbar {
    display: none !important;
  }
}

.forms-completion-status {
  display: inline-flex;
  align-items: center;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.forms-completion-status.is-completed { background: #fff4ce; color: #5b4300; }
.forms-completion-status.is-shared { background: #dff4e3; color: #145a27; }
.forms-card-submitted { font-weight: 600; }

/* v3.0: completed forms are locked and visually greyed until re-opened. */
.forms-plugin.is-completed [data-field]:disabled {
  background: #e5e7eb !important;
  color: #4b5563 !important;
  border-color: #c7cbd1 !important;
  cursor: not-allowed !important;
  opacity: 1 !important;
  resize: none !important;
}

.forms-plugin.is-completed .qblock:has([data-field]:disabled),
.forms-plugin.is-completed .twocol:has([data-field]:disabled),
.forms-plugin.is-completed table.fillable td:has([data-field]:disabled) {
  background: #f3f4f6 !important;
}

.forms-plugin .reopen-button {
  background: #fff !important;
  color: var(--accent) !important;
  border: 1px solid var(--accent) !important;
}

.forms-plugin .reopen-button:hover {
  background: #f6f2fb !important;
}

.forms-completion-status.is-amendment {
  background: #e8eef9;
  color: #203d70;
}

.forms-status-amendment {
  background: #e8eef9 !important;
}
