/* Shared field rendering and grouped record editors. */
input, select, textarea { color: var(--ink); background: #fff; border: 1px solid #bfcede; border-radius: 5px; padding: 8px 10px; min-height: 38px; max-width: 100%; }
input:hover, select:hover, textarea:hover { border-color: #829dbd; }
input:disabled, select:disabled, textarea:disabled { background: #edf1f6; color: #697b8f; }
textarea { resize: vertical; }
.field { min-width: 0; margin-bottom: 14px; }
.field > label { display: block; font-size: 12px; font-weight: 650; margin-bottom: 5px; }
.field input, .field select, .field textarea { width: 100%; }
.required { color: #b13a42; }
.help { color: var(--muted); font-size: 11px; margin-top: 5px; }
.help ul { padding-left: 16px; margin: 4px 0; }
.field-error { font-size: 12px; color: var(--error); margin-top: 5px; }
.has-error input, .has-error select, .has-error textarea { border-color: var(--error); }
.form-errors { border: 1px solid #e2a4ac; background: #fff1f3; color: var(--error); padding: 12px 16px; border-radius: 6px; margin-bottom: 18px; font-size: 13px; }
.form-errors ul { padding-left: 18px; margin: 0; }
.primary, .secondary { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 38px; padding: 8px 14px; border: 1px solid transparent; border-radius: 5px; font-size: 12px; font-weight: 650; white-space: nowrap; cursor: pointer; }
.primary { color: #fff; background: var(--accent); }
.primary:hover { background: var(--accent-dark); color: #fff; text-decoration: none; }
.secondary { color: var(--ink); background: #fff; border-color: #bfcede; }
.secondary:hover { background: #edf3fc; text-decoration: none; }
.primary.full { width: 100%; }
.text-button { background: none; border: none; min-height: 30px; padding: 5px 0; color: var(--accent-dark); font-size: 12px; }
.editor-card, .form-section { padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; margin-bottom: 16px; }
.form-section > h2, .editor-card > h2 { margin-bottom: 16px; }
.form-section > header { display: flex; align-items: baseline; gap: 12px; margin-bottom: 16px; border-bottom: 1px solid #e8edf4; padding-bottom: 12px; }
.section-number { color: var(--accent); font-size: 12px; font-weight: 700; }
.form-section > header p { color: var(--muted); font-size: 12px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 20px; }
.form-grid .field:has(textarea), .field-wide { grid-column: 1 / -1; }
.field input[type=checkbox] { width: 18px; height: 18px; min-height: 18px; flex-shrink: 0; }
.checkbox-field { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.checkbox-field > label { order: 1; margin: 0; }
.checkbox-field > .help, .checkbox-field > .field-error { order: 2; flex-basis: 100%; }
.form-actions { justify-content: flex-end; border-top: 1px solid var(--line); padding: 14px 0 0; }
.sticky-actions { position: sticky; z-index: 4; bottom: 0; padding: 12px 18px; border: 1px solid var(--line); border-radius: 7px; background: #ffffffed; backdrop-filter: blur(8px); box-shadow: 0 -5px 16px #17355008; }
.save-status { margin-right: auto; font-size: 12px; color: var(--muted); }
.save-status[data-dirty] { color: #8c510b; font-weight: 650; }
.section-links { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.section-links a { background: #e7edf6; border-radius: 4px; padding: 5px 10px; font-size: 12px; }
.form-section { scroll-margin-top: 18px; }
.person-entry { border-top: 1px solid var(--line); padding-top: 18px; margin-top: 4px; }
.context-links { margin-bottom: 16px; font-size: 12px; }
.context-links a { margin-right: 12px; text-decoration: underline; }
.select-search { margin-bottom: 5px; font-size: 12px; }
.field .text-button { font-size: 11px; margin-right: 8px; }
.notice { padding: 14px 18px; border: 1px solid #e4cc9b; border-left: 3px solid #c08a25; border-radius: 5px; background: #fff9ec; margin-bottom: 18px; font-size: 13px; }
.notice h2 { font-size: 15px; margin-bottom: 6px; }
.notice p + p { margin-top: 6px; }
.settings-card { display: grid; grid-template-columns: minmax(180px, 1fr) 2fr; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; overflow: hidden; }
.settings-intro { padding: 24px; background: #edf3fb; border-right: 1px solid var(--line); }
.settings-intro h2 { margin: 10px 0; }
.settings-intro p { color: var(--muted); font-size: 12px; }
.settings-form { padding: 24px; }
.editor-toolbar { display: flex; gap: 5px; padding: 6px; border: 1px solid #bfcede; border-radius: 5px 5px 0 0; background: #edf3fb; }
.editor-toolbar button { background: #fff; border: 1px solid #c5d3e3; color: var(--ink); border-radius: 3px; padding: 5px 10px; font-size: 12px; }
.rich-editor { background: #fff; min-height: 120px; padding: 12px; border: 1px solid #bfcede; border-top: 0; border-radius: 0 0 5px 5px; overflow-wrap: anywhere; }
