/* Shared form controls inherit public theme tokens or the native admin palette. */
.kf-form,.kf-page,.kf-admin {
  --kf-surface:var(--admin-surface,var(--surface,#fff));
  --kf-text:var(--admin-text,var(--text,#242331));
  --kf-border:var(--admin-border,var(--border,#dcdde3));
  --kf-muted:var(--admin-muted,var(--muted,#655d70));
  --kf-accent:var(--admin-accent,var(--accent,#623291));
  --kf-radius:var(--radius-small,var(--radius-1,8px));
  color:var(--kf-text);text-align:left;min-width:0;
}
.kf-form *,.kf-admin *,.kf-page * {box-sizing:border-box;}
.kf-form [hidden],.kf-admin [hidden] {display:none!important;}
.kf-page {max-width:64rem;margin:0 auto;padding:1rem;font:16px/1.5 var(--font-body,system-ui,sans-serif);}
.kf-admin {max-width:70rem;font-size:1rem;line-height:1.5;}
.kf-form,.kf-editor,.kf-delivery {padding:clamp(1rem,3vw,1.5rem);border:1px solid var(--kf-border);border-radius:var(--radius,var(--radius-2,12px));background:var(--kf-surface);}
.kf-form {max-width:48rem;margin:1.25rem auto;}
.kf-editor,.kf-delivery {margin:1rem 0;}
.kf-form h2,.kf-admin h1,.kf-admin h2 {margin:0 0 .75rem;line-height:1.2;overflow-wrap:anywhere;}
.kf-form h2 {font-size:clamp(1.25rem,3vw,1.5rem);}
.kf-form>p,.kf-admin p {margin:.5rem 0 1rem;}
.kf-nav,.kf-actions {display:flex;align-items:center;gap:.5rem;flex-wrap:wrap;margin:0 0 1rem;}
.kf-form label,.kf-editor label,.kf-delivery label {display:block;font-weight:600;margin:.75rem 0 .35rem;}
.kf-form :is(input:not([type=radio]):not([type=checkbox]),select,textarea),
.kf-editor :is(input:not([type=checkbox]),select,textarea) {
  width:100%;max-width:100%;min-width:0;min-height:44px;padding:.65rem .75rem;border:1px solid var(--kf-border);
  border-radius:var(--kf-radius);background:var(--kf-surface);color:var(--kf-text);font:inherit;font-size:16px;line-height:1.4;
}
.kf-form textarea,.kf-editor textarea {resize:vertical;}
.kf-form button,.kf-admin button,.kf-admin a.kf-button,.kf-page a.kf-button {
  display:inline-flex;align-items:center;justify-content:center;gap:.4rem;min-height:44px;
  padding:.65rem 1rem;border:1px solid transparent;border-radius:var(--kf-radius,8px);
  font:600 1rem/1.3 var(--font-body,system-ui,sans-serif);background:var(--kf-accent,#623291);
  color:var(--accent-contrast,#fff);cursor:pointer;text-decoration:none;text-align:center;white-space:normal;
}
.kf-admin .kf-secondary,.kf-nav a,.kf-actions a {
  display:inline-flex;align-items:center;justify-content:center;min-height:44px;padding:.6rem .8rem;
  border:1px solid var(--kf-border);border-radius:var(--kf-radius);background:var(--kf-surface);color:var(--kf-text);font-weight:600;text-decoration:none;
}
.kf-form button:disabled,.kf-admin button:disabled {opacity:.5;cursor:default;}
.kf-form :is(input,textarea,select,button):focus-visible,.kf-admin :is(input,textarea,select,button,a,summary):focus-visible,.kf-page a:focus-visible {
  outline:3px solid var(--kf-accent);outline-offset:3px;
}
.kf-form fieldset {min-width:0;border:1px solid var(--kf-border);border-radius:var(--kf-radius);padding:.75rem;margin:1rem 0;}
.kf-form legend {padding:0 .25rem;font-weight:600;}
.kf-form .kf-choice,.kf-editor .kf-check,.kf-delivery label {
  display:flex;gap:.65rem;align-items:center;min-height:44px;padding:.5rem 0;font-weight:400;
}
.kf-choice input,.kf-check input,.kf-delivery [type=checkbox] {flex:0 0 auto;width:20px;height:20px;margin:0;accent-color:var(--kf-accent);}
.kf-form [aria-invalid=true] {border-color:#b42318;}
.kf-error {color:#a51d14;margin:.3rem 0;font-size:.94rem;}
.kf-error:empty,[data-form-status]:empty {display:none;}
.kf-trap {position:absolute!important;left:-10000px!important;width:1px;height:1px;overflow:hidden;}
.kf-notice {padding:.75rem 1rem;border-left:3px solid var(--kf-accent);background:var(--kf-surface);border-radius:var(--kf-radius);}
.kf-list {list-style:none;padding:0;display:grid;gap:.75rem;}
.kf-list li {min-width:0;padding:1rem;border:1px solid var(--kf-border);border-radius:var(--kf-radius);background:var(--kf-surface);}
.kf-list strong {overflow-wrap:anywhere;}
.kf-list .kf-actions {margin:.75rem 0 0;}
.kf-list p:last-child {margin-bottom:0;}
.kf-badge {display:inline-block;margin-left:.4rem;padding:.15rem .5rem;border:1px solid var(--kf-border);border-radius:999px;font-size:.8rem;color:var(--kf-muted);}
.kf-page dd,.kf-admin dd {margin:0 0 1rem;}
.kf-page pre,.kf-admin pre {white-space:pre-wrap;overflow-wrap:anywhere;font:inherit;}
.kf-page dt,.kf-admin dt {font-weight:700;}
.kf-editor details,.kf-delivery details,.kf-setup {margin:.75rem 0;border:1px solid var(--kf-border);border-radius:var(--kf-radius);min-width:0;}
.kf-editor summary,.kf-delivery summary,.kf-setup>summary {min-height:44px;padding:.75rem;cursor:pointer;font-weight:600;overflow-wrap:anywhere;}
.kf-editor details[open]>summary,.kf-delivery details[open]>summary {border-bottom:1px solid var(--kf-border);}
.kf-detail-body {padding:0 .75rem .75rem;}
.kf-field-summary {display:inline;}
.kf-field-summary small {font-weight:400;color:var(--kf-muted);margin-left:.5rem;}
.kf-field-actions {display:flex;gap:.5rem;flex-wrap:wrap;margin:1rem 0 0;}
.kf-field-actions button {flex:1;padding:.6rem .65rem;}
.kf-save-bar {position:sticky;bottom:var(--admin-mobile-tab-space,0px);z-index:2;display:flex;align-items:center;justify-content:space-between;gap:1rem;flex-wrap:wrap;padding:.75rem 0 calc(.75rem + env(safe-area-inset-bottom));margin:1rem 0 0;background:var(--kf-surface);border-top:1px solid var(--kf-border);}
.kf-delivery {font-size:.95rem;}
@media(min-width:700px) {
  .kf-field-grid {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 1rem;}
  .kf-field-wide {grid-column:1/-1;}
  .kf-list {grid-template-columns:repeat(2,minmax(0,1fr));}
}
@media(max-width:540px) {
  .kf-form {margin:1rem 0;}
  .kf-form>button[type=submit],.kf-save-bar>button {width:100%;}
  .kf-admin .kf-editor,.kf-admin .kf-delivery {padding:1rem;}
  .kf-admin h1 {font-size:1.65rem;}
}

/* Enquiries keeps reading messages ahead of form configuration. */
.kf-screen-heading {margin-bottom:1rem;}
.kf-muted,.kf-screen-heading p {color:var(--kf-muted);}
.kf-list.kf-enquiries,.kf-list.kf-messages {grid-template-columns:1fr;}
.kf-enquiry-title {display:flex;align-items:baseline;justify-content:space-between;gap:.5rem;flex-wrap:wrap;}
.kf-enquiry-title h2 {font-size:1.1rem;margin:0;min-width:0;flex:1 1 15rem;overflow-wrap:anywhere;white-space:normal;max-height:none;}
.kf-list-filters {display:flex;align-items:end;gap:.75rem;flex-wrap:wrap;margin:1rem 0;}
.kf-list-filters label {display:grid;gap:.25rem;min-width:0;flex:1 1 12rem;font-weight:600;}
.kf-list-filters :is(input,select) {width:100%;min-width:0;min-height:44px;font:inherit;padding:.6rem;border:1px solid var(--kf-border);border-radius:var(--kf-radius);background:var(--kf-surface);color:var(--kf-text);}
.kf-enquiry-title .kf-badge {margin:0;}
.kf-enquiries li {padding:.875rem;}
.kf-enquiries .kf-actions {margin-top:.5rem;}
.kf-enquiries .kf-muted {margin:.25rem 0;}
.kf-list.kf-enquiries {gap:0;border:1px solid var(--kf-border);border-radius:var(--kf-radius);overflow:visible;}
.kf-list .kf-enquiry-row {display:flex;align-items:center;justify-content:space-between;gap:.65rem;padding:.75rem;border:0;border-bottom:1px solid var(--kf-border);border-radius:0;}
.kf-list .kf-enquiry-row:last-child {border-bottom:0;}
.kf-enquiry-content {min-width:0;flex:1;}
.kf-enquiry-content h2 {font-size:1rem;line-height:1.3;margin:0;overflow-wrap:anywhere;white-space:normal;max-height:none;}
.kf-enquiry-content .kf-enquiry-meta {font-size:.85rem;color:var(--kf-muted);margin:.25rem 0 0;line-height:1.35;}
.kf-enquiry-actions {display:flex;align-items:center;gap:.5rem;flex:0 0 auto;}
.kf-form-options {position:relative;}
.kf-form-options summary {display:flex;align-items:center;justify-content:center;min-height:44px;padding:.5rem .65rem;border:1px solid var(--kf-border);border-radius:var(--kf-radius);cursor:pointer;font-weight:600;}
.kf-form-options>div {position:absolute;right:0;top:calc(100% + .25rem);z-index:4;min-width:9rem;background:var(--kf-surface);border:1px solid var(--kf-border);border-radius:var(--kf-radius);padding:.25rem;box-shadow:0 6px 18px #0002;}
.kf-form-options a {display:flex;align-items:center;min-height:44px;padding:.5rem .65rem;color:var(--kf-text);}
.kf-pagination {display:flex;align-items:center;gap:.5rem;flex-wrap:wrap;margin:1rem 0;}
.kf-pagination p {margin:0 auto 0 0;}
@media(max-width:600px) {
  .kf-list .kf-enquiry-row {display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:.5rem;padding:.65rem .75rem;}
  .kf-enquiry-actions {margin-top:0;justify-content:flex-end;}
  .kf-enquiry-actions .kf-button {padding:.5rem .75rem;font-size:.94rem;}
}
.kf-setup>p {padding:0 .75rem .75rem;margin:0;}
.kf-empty {padding:1rem;border:1px solid var(--kf-border);border-radius:var(--kf-radius);background:var(--kf-surface);}
.kf-empty h2 {font-size:1.15rem;}
.kf-message-link {display:flex;align-items:center;justify-content:space-between;gap:.75rem;min-height:44px;text-decoration:none;flex-wrap:wrap;}
.kf-message-link time {color:var(--kf-muted);font-size:.9rem;}
.kf-message-values {padding:1rem;border:1px solid var(--kf-border);border-radius:var(--kf-radius);background:var(--kf-surface);}
.kf-message-values dd {padding-bottom:.75rem;border-bottom:1px solid var(--kf-border);}
.kf-message-values dd:last-child {border:0;margin-bottom:0;padding-bottom:0;}
[data-editor-status]:empty {display:none;}
