/* OPS Legal Forms Console — screen UI only (PDF layout is built in pdf.js) */

:root {
  --ink: #1a1a1a;
  --muted: #555;
  --line: #333;
  --accent: #1e3a5f;
  --accent-light: #2c5282;
  --paper: #fff;
  --bg: #eef1f5;
  --border: #ccd3dc;
  --exec-fill: #eef1f6;
  --exec-border: #8a94a6;
  --exec-hint: #7a8494;
  --font-doc: 'Times New Roman', Times, serif;
  --font-ui: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-ui);
  background: #050c1a;
  color: #f1f5f9;
  min-height: 100vh;
}

body.is-form-view {
  background: var(--bg);
  color: var(--ink);
}

button,
input,
select,
textarea {
  font-family: inherit;
}

/* ---- Field Kit style app shell ---- */

.fk-app-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem clamp(1rem, 3vw, 1.5rem);
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  position: sticky;
  top: 0;
  z-index: 100;
}

.fk-app-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.fk-app-logo {
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

.fk-app-label {
  font-family: Inter, var(--font-ui);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #38bdf8;
}

.fk-app-title {
  font-family: Inter, var(--font-ui);
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #f1f5f9;
}

.fk-app-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.fk-form-active-label {
  font-family: Inter, var(--font-ui);
  font-size: 0.85rem;
  font-weight: 600;
  color: #94a3b8;
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lang-select {
  padding: 0.4rem 0.55rem;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(15, 23, 42, 0.8);
  color: #f1f5f9;
  font-size: 0.85rem;
  font-family: Inter, var(--font-ui);
}

.lang-select option {
  color: #000;
  background: #fff;
}

.fk-btn {
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  font-family: Inter, var(--font-ui);
  transition: transform 0.15s, background 0.15s, border-color 0.15s;
}

.fk-btn-primary {
  background: linear-gradient(135deg, #2563eb, #0ea5e9);
  color: #fff;
  box-shadow: 0 4px 16px rgba(56, 189, 248, 0.25);
}

.fk-btn-primary:hover {
  transform: translateY(-1px);
}

.fk-btn-danger {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.35);
  color: #fca5a5;
}

.fk-btn-ghost {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(148, 163, 184, 0.2);
  color: #e2e8f0;
}

.save-indicator {
  font-size: 0.75rem;
  color: #94a3b8;
  font-family: Inter, var(--font-ui);
}

/* ---- Dashboard (Field Kit Hub style) ---- */

.fk-dash {
  padding: 1.5rem clamp(1rem, 3vw, 2rem) 2.5rem;
}

.fk-dash-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.fk-topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.fk-topbar-text h1 {
  margin: 0;
  font-family: Inter, var(--font-ui);
  font-size: clamp(1.35rem, 3vw, 1.85rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #f1f5f9;
}

.fk-topbar-text p {
  margin: 0.35rem 0 0;
  font-family: Inter, var(--font-ui);
  color: #94a3b8;
  font-size: 0.9rem;
}

.fk-topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.fk-search-wrap {
  margin-bottom: 1.5rem;
}

.fk-search-label {
  display: block;
  margin-bottom: 0.4rem;
  font-family: Inter, var(--font-ui);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #94a3b8;
}

.fk-search-input {
  width: 100%;
  max-width: 420px;
  padding: 0.65rem 1rem 0.65rem 2.5rem;
  font-family: Inter, var(--font-ui);
  font-size: 0.95rem;
  color: #f1f5f9;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 999px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85zm-5.242.156a4.5 4.5 0 1 1 0-9 4.5 4.5 0 0 1 0 9z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 0.9rem center;
}

.fk-search-input::placeholder {
  color: #64748b;
}

.fk-search-input:focus {
  border-color: rgba(96, 165, 250, 0.55);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.fk-search-empty {
  margin: 0.65rem 0 0;
  font-family: Inter, var(--font-ui);
  font-size: 0.88rem;
  color: #94a3b8;
}

.fk-form-card[hidden] {
  display: none !important;
}

.fk-zone[hidden] {
  display: none !important;
}

.fk-status {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-family: Inter, var(--font-ui);
  font-size: 0.78rem;
  color: #94a3b8;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.12);
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
}

.fk-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 8px #4ade80;
  animation: fk-pulse 2s infinite;
}

.fk-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  font-family: Inter, var(--font-ui);
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s, background 0.15s;
}

.fk-pill-ghost {
  background: rgba(15, 23, 42, 0.72);
  border-color: rgba(148, 163, 184, 0.12);
  color: #f1f5f9;
}

.fk-pill-ghost:hover {
  transform: translateY(-1px);
  border-color: rgba(56, 189, 248, 0.35);
  background: rgba(30, 41, 59, 0.9);
}

@keyframes fk-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.fk-zone {
  margin-bottom: 2rem;
}

.fk-zone-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.fk-zone-head h2 {
  margin: 0;
  font-family: Inter, var(--font-ui);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #94a3b8;
}

.fk-zone-sub {
  font-family: Inter, var(--font-ui);
  font-size: 0.75rem;
  color: #64748b;
}

.fk-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
}

.fk-form-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.1rem;
  background: linear-gradient(145deg, rgba(30, 41, 59, 0.8), rgba(15, 23, 42, 0.9));
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 16px;
  text-align: left;
  color: inherit;
  cursor: pointer;
  font-family: Inter, var(--font-ui);
  transition: transform 0.18s, border-color 0.18s, box-shadow 0.18s;
  position: relative;
  overflow: hidden;
  min-height: 100%;
}

.fk-form-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 100% 0%, rgba(56, 189, 248, 0.1), transparent 55%);
  pointer-events: none;
}

.fk-form-card:not(:disabled):hover {
  transform: translateY(-4px);
  border-color: rgba(56, 189, 248, 0.35);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(56, 189, 248, 0.1);
}

.fk-form-card--soon {
  cursor: not-allowed;
  opacity: 0.72;
}

.fk-form-card--soon:hover {
  transform: none;
  box-shadow: none;
  border-color: rgba(148, 163, 184, 0.12);
}

.fk-form-art {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  background: hsl(var(--hue, 210) 55% 42% / 0.2);
  border: 1px solid hsl(var(--hue, 210) 55% 50% / 0.32);
  position: relative;
  z-index: 1;
}

.fk-form-info {
  position: relative;
  z-index: 1;
  flex: 1;
}

.fk-form-info h3 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: #f1f5f9;
  line-height: 1.35;
}

.fk-form-info p {
  margin: 0.2rem 0 0;
  font-size: 0.78rem;
  color: #94a3b8;
  line-height: 1.45;
}

.fk-form-go {
  position: relative;
  z-index: 1;
  margin-top: auto;
  font-size: 0.72rem;
  font-weight: 700;
  color: #38bdf8;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.fk-form-soon {
  position: relative;
  z-index: 1;
  margin-top: auto;
  align-self: flex-start;
  padding: 0.22rem 0.5rem;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fde047;
  background: rgba(250, 204, 21, 0.12);
  border: 1px solid rgba(250, 204, 21, 0.35);
  border-radius: 4px;
}

@media (max-width: 900px) {
  .fk-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .fk-form-grid {
    grid-template-columns: 1fr;
  }

  .fk-form-active-label {
    display: none;
  }
}

/* Legacy btn classes (save dialog) */

.btn {
  padding: 0.45rem 0.85rem;
  border-radius: 4px;
  border: 1px solid transparent;
  font-size: 0.875rem;
  cursor: pointer;
  font-weight: 500;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-secondary {
  background: #fff;
  color: var(--ink);
  border-color: var(--border);
}

.btn-danger {
  background: #c53030;
  color: #fff;
}

.btn-ghost {
  background: transparent;
  color: #fff;
  border: none;
  text-decoration: underline;
  padding: 0.35rem 0.5rem;
}

/* ---- Form screen ---- */

.screen-form {
  padding: 1rem;
  max-width: 920px;
  margin: 0 auto;
}

.legal-document {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1.25rem;
  font-family: var(--font-doc);
  font-size: 12pt;
  line-height: 1.45;
  color: var(--ink);
}

.doc-top-rule {
  border-top: 1px solid var(--line);
  margin-bottom: 0.75rem;
}

.doc-title {
  text-align: center;
  font-weight: bold;
  font-size: 14pt;
  text-transform: uppercase;
  margin: 0 0 0.25rem;
}

.doc-subtitle,
.doc-title-underline {
  text-align: center;
  font-weight: bold;
  font-size: 12pt;
  text-transform: uppercase;
  text-decoration: underline;
  margin: 0 0 1rem;
}

.agency-row,
.meta-row {
  margin-bottom: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  align-items: baseline;
}

.legal-document .label,
.legal-document .field-inline label,
.sig-label {
  font-weight: bold;
}

.meta-row.split {
  justify-content: space-between;
}

.field-inline {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  flex: 1;
  min-width: 140px;
}

.field-input {
  flex: 1;
  border: 1px solid var(--exec-border);
  border-radius: 3px;
  background: var(--exec-fill);
  font-family: var(--font-doc);
  font-size: 12pt;
  padding: 0.35rem 0.45rem;
  min-width: 60px;
  min-height: 1.85rem;
  outline: none;
}

.field-input::placeholder {
  color: var(--exec-hint);
  font-style: italic;
  font-size: 10pt;
  font-family: var(--font-ui);
}

.field-input:focus {
  border-color: var(--accent-light);
  background: #fff;
  box-shadow: 0 0 0 2px rgba(44, 82, 130, 0.18);
}

.field-input.sm { max-width: 130px; }
.field-input.md { max-width: 200px; }
.field-input.lg { min-width: 180px; }

.intro-caps {
  text-transform: uppercase;
  font-size: 11pt;
  margin: 0.75rem 0;
}

.right-item {
  margin-bottom: 0.75rem;
}

.right-text .num {
  font-weight: normal;
}

.right-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  padding-left: 1rem;
  font-size: 10pt;
  font-family: var(--font-ui);
  color: var(--muted);
}

.officer-check {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
}

.officer-check input {
  width: 16px;
  height: 16px;
}

.initials-pad-wrap {
  display: inline-block;
  width: 110px;
  vertical-align: middle;
  position: relative;
  border: 1px solid var(--exec-border);
  border-radius: 4px;
  background: var(--exec-fill);
  padding: 0.2rem;
}

.initials-pad-wrap.is-empty::before {
  content: attr(data-hint);
  position: absolute;
  left: 50%;
  top: 38%;
  transform: translate(-50%, -50%);
  font-size: 0.65rem;
  font-family: var(--font-ui);
  font-style: italic;
  color: var(--exec-hint);
  pointer-events: none;
  z-index: 0;
}

.initials-pad-wrap canvas {
  height: 44px;
  display: block;
  width: 100%;
  background: #fff;
  border-radius: 2px;
  touch-action: none;
  position: relative;
  z-index: 1;
}

.doc-divider {
  border: none;
  border-top: 1px solid var(--line);
  margin: 1rem 0;
}

.doc-divider.dotted {
  border-top-style: dotted;
}

.section-title {
  text-align: center;
  font-weight: bold;
  text-transform: uppercase;
  text-decoration: underline;
  margin: 0 0 0.5rem;
  font-size: 12pt;
}

.waiver-text {
  text-align: justify;
  margin-bottom: 0.75rem;
}

.waiver-text p {
  margin: 0 0 0.5rem;
}

.consent-body {
  text-align: justify;
  margin: 0.75rem 0 1rem;
}

.consent-body p {
  margin: 0 0 0.65rem;
  line-height: 1.45;
}

.consent-ack {
  font-weight: 600;
}

.field-block {
  margin: 0.75rem 0 1rem;
}

.field-block-label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.field-textarea {
  width: 100%;
  min-height: 8rem;
  resize: vertical;
  line-height: 1.45;
}

.field-line-warn {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: #b45309;
}

.field-line-warn[hidden] {
  display: none;
}

.currency-denom-block {
  margin: 0.75rem 0 1rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border, #ccc);
  border-radius: 4px;
}

.currency-denom-block legend {
  font-weight: 700;
  padding: 0 0.35rem;
}

.currency-denom-hint {
  margin: 0 0 0.65rem;
  font-size: 0.88rem;
  color: var(--muted, #666);
}

.currency-denom-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem 1rem;
}

.currency-denom-row {
  display: grid;
  grid-template-columns: 2.5rem 1fr;
  align-items: center;
  gap: 0.5rem;
}

.currency-denom-label {
  font-weight: 700;
}

@media (max-width: 640px) {
  .currency-denom-grid {
    grid-template-columns: 1fr;
  }
}

.oath-nj-body {
  width: 100%;
}

.oath-nj-caps {
  text-transform: uppercase;
  text-align: left;
  line-height: 1.5;
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
}

.oath-nj-label {
  font-weight: 700;
  text-transform: uppercase;
  display: block;
  margin-bottom: 0.35rem;
}

.oath-nj-sworn-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin: 1rem 0 1.25rem;
  text-transform: uppercase;
  font-size: 0.95rem;
  line-height: 1.6;
}

.oath-nj-sworn-line .fill-blank.sm {
  width: 2.5rem;
  text-align: center;
}

.oath-nj-sworn-line .fill-blank.md {
  width: 8rem;
}

.oath-nj-sworn-line .fill-blank.xs {
  width: 2rem;
  text-align: center;
}

.oath-nj-year-prefix {
  font-weight: 600;
}

.oath-nj-sig-block,
.oath-nj-line-field {
  margin: 1.25rem 0;
  width: 100%;
}

.oath-nj-sig-block .sig-pad-wrap {
  width: 100%;
}

.oath-nj-caption {
  text-align: center;
  text-transform: uppercase;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  margin-top: 0.35rem;
}

.oath-nj-line-field .field-input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--exec-border);
  border-radius: 4px;
  background: var(--exec-fill);
  min-height: 2.5rem;
  padding: 0.45rem 0.6rem;
  font-family: var(--font-doc);
  font-size: 12pt;
}

.oath-nj-line-field .field-input:focus {
  outline: none;
  border-color: var(--accent, #2563eb);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.fill-blank {
  border: 1px solid var(--exec-border);
  border-radius: 3px;
  background: var(--exec-fill);
  font-family: var(--font-doc);
  font-size: 12pt;
  padding: 0.3rem 0.45rem;
  min-width: 100px;
  min-height: 1.85rem;
  outline: none;
}

.fill-blank::placeholder {
  color: var(--exec-hint);
  font-style: italic;
  font-size: 10pt;
  font-family: var(--font-ui);
}

.fill-blank:focus {
  border-color: var(--accent-light);
  background: #fff;
  box-shadow: 0 0 0 2px rgba(44, 82, 130, 0.18);
}

.fill-blank.sm { min-width: 70px; }
.fill-blank.xs { min-width: 44px; }
.fill-blank.md { min-width: 140px; }
.fill-blank.lg { min-width: 180px; }

.sig-block { margin-bottom: 0.75rem; }

.sig-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.sig-row.single {
  grid-template-columns: 1fr;
  max-width: 55%;
}

.sig-row-adult {
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.sig-col {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.sig-label {
  display: block;
  font-size: 10pt;
  font-family: var(--font-ui);
  font-weight: bold;
  margin-bottom: 0.15rem;
}

.sig-pad-wrap {
  border: 1px solid var(--exec-border);
  border-radius: 4px;
  background: var(--exec-fill);
  padding: 0.25rem;
  touch-action: none;
  position: relative;
}

.sig-pad-wrap.is-empty::before {
  content: attr(data-hint);
  position: absolute;
  left: 50%;
  top: 42%;
  transform: translate(-50%, -50%);
  font-size: 0.75rem;
  font-family: var(--font-ui);
  font-style: italic;
  color: var(--exec-hint);
  pointer-events: none;
  z-index: 0;
}

.sig-pad-wrap canvas {
  display: block;
  width: 100%;
  height: 64px;
  cursor: crosshair;
  background: #fff;
  border-radius: 2px;
  position: relative;
  z-index: 1;
}

.sig-pad-wrap.tall canvas {
  height: 72px;
}

.sig-clear {
  font-size: 0.65rem;
  padding: 0.1rem 0.35rem;
  margin-top: 0.15rem;
  cursor: pointer;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--muted);
}

.sig-caption {
  text-align: center;
  font-size: 10pt;
  margin-top: 0.15rem;
}

.sig-date-row {
  margin-top: 0.25rem;
}

.juv-parent-witness-row {
  align-items: start;
}

.page-break-before {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 2px dashed var(--border);
}

.execution-stamp {
  margin-top: 1.75rem;
  padding-top: 0.75rem;
  margin-bottom: 0.75rem;
  border-top: 1px solid var(--line);
  font-family: var(--font-ui);
  font-size: 9pt;
  color: var(--muted);
  text-align: center;
  clear: both;
}

.legal-document:has(.execution-stamp:not([hidden])) {
  padding-bottom: 1.5rem;
}

.sig-block-adult {
  margin-bottom: 0.5rem;
}

[hidden] {
  display: none !important;
}

/* ---- Description modal (Field Kit style) ---- */

.desc-dialog {
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: 16px;
  padding: 0;
  max-width: 640px;
  width: calc(100% - 2rem);
  background: linear-gradient(145deg, rgba(30, 41, 59, 0.98), rgba(15, 23, 42, 0.99));
  color: #f1f5f9;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(56, 189, 248, 0.08);
  font-family: Inter, var(--font-ui);
}

.desc-dialog::backdrop {
  background: rgba(5, 12, 26, 0.78);
  backdrop-filter: blur(4px);
}

.desc-dialog h3 {
  margin: 0;
  padding: 1.25rem 1.5rem 0.75rem;
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #f1f5f9;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.desc-dialog-body {
  margin: 0;
  padding: 1.25rem 1.5rem;
  font-size: 0.9rem;
  line-height: 1.65;
  color: #cbd5e1;
  max-height: min(52vh, 420px);
  overflow-y: auto;
}

.desc-dialog .dialog-actions {
  padding: 0 1.5rem 1.25rem;
}

.desc-dialog .fk-btn-primary {
  min-width: 6rem;
}

/* ---- Save dialog ---- */

.save-dialog {
  border: none;
  border-radius: 8px;
  padding: 1.5rem;
  max-width: 400px;
  width: calc(100% - 2rem);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.save-dialog::backdrop {
  background: rgba(0, 0, 0, 0.45);
}

.save-dialog h3 {
  margin: 0 0 0.5rem;
  color: var(--accent);
}

.save-dialog p {
  margin: 0 0 1rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.save-dialog label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.save-dialog input[type='text'] {
  width: 100%;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 1rem;
  margin-bottom: 1rem;
}

.dialog-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

.dialog-actions .btn-primary {
  background: var(--accent);
  color: #fff;
}

.dialog-actions .btn-secondary {
  background: #fff;
  color: var(--ink);
  border-color: var(--border);
}

@media (max-width: 640px) {
  .legal-document {
    padding: 1rem 0.75rem;
    font-size: 11pt;
  }

  .agency-row,
  .meta-row,
  .meta-row.split {
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
  }

  .field-inline {
    flex-direction: column;
    align-items: stretch;
    min-width: 0;
    width: 100%;
    gap: 0.35rem;
  }

  .field-input,
  .fill-blank {
    width: 100%;
    max-width: none;
    min-width: 0;
    font-size: 16px;
    min-height: 2.75rem;
    box-sizing: border-box;
  }

  .field-input.sm,
  .field-input.md,
  .field-input.lg {
    max-width: none;
  }

  .fill-blank.sm,
  .fill-blank.md,
  .fill-blank.lg,
  .fill-blank.xs {
    min-width: 0;
    width: 100%;
  }

  .sig-row,
  .sig-row-adult {
    grid-template-columns: 1fr;
  }

  .sig-row.single {
    max-width: none;
  }

  .sig-field-datetime .field-inline {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
  }

  .sig-field-datetime .field-input.sm {
    flex: 1 1 120px;
    width: auto;
  }

  .right-controls {
    padding-left: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .initials-pad-wrap {
    width: 100%;
    max-width: 180px;
  }

  .sig-pad-wrap {
    width: 100%;
  }

  .sig-pad-wrap canvas {
    width: 100% !important;
    height: auto !important;
  }

  .oath-nj-sworn-line {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
}
