/* CAEL 0.6.27: shared form density and section navigation.
   Presentation only. Business visibility, saved layouts and disabled states
   retain ownership. Inactive steps never disable or remove their controls. */
@media screen {
  :root {
    --f627-control-height:34px;
    --f627-control-font:13px;
    --f627-control-padding:6px 9px;
    --f627-grid-gap:12px;
    --f627-textarea-height:64px;
    --f627-surface:var(--u598-surface,#fff);
    --f627-input:var(--u598-input,#fff);
    --f627-text:var(--u598-text,#263342);
    --f627-muted:var(--u598-muted,#5d6a78);
    --f627-line:var(--u598-line,#dce3e9);
    --f627-selected:var(--u598-selected,#e7f1f2);
    --f627-selected-text:var(--u598-selected-text,#075967);
    --f627-focus:var(--u598-focus,#087086);
  }

  /* Include page forms, native drawers and module-owned dialogs. */
  html[data-interface567] :is(form,.f627-surface,.f627-root,.f627-external,dialog) :is(input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="image"]),select,textarea) {
    box-sizing:border-box;
    min-width:0;
    max-width:100%;
    min-height:var(--f627-control-height)!important;
    padding:var(--f627-control-padding)!important;
    border-radius:6px!important;
    font-size:var(--f627-control-font)!important;
    line-height:1.4!important;
  }
  html[data-interface567] :is(form,.f627-surface,.f627-root,.f627-external,dialog) textarea {
    min-height:var(--f627-textarea-height)!important;
    height:var(--f627-textarea-height);
    resize:vertical;
  }
  html[data-interface567] :is(form,.f627-surface,.f627-root,.f627-external,dialog) :is(input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="image"]):not([type="file"]),select:not([multiple]):not([size])) {height:var(--f627-control-height)!important;}
  html[data-interface567] :is(form,.f627-surface,.f627-root,.f627-external,dialog) :is(label,.nf-field) {
    font-size:12px;
    line-height:1.4;
    row-gap:4px;
  }
  html[data-interface567] :is(form,.f627-surface,.f627-root,.f627-external,dialog) :is(input[type="checkbox"],input[type="radio"]) {
    width:17px;
    height:17px;
    min-height:17px;
    flex-shrink:0;
  }
  html[data-interface567] :is(form,.f627-surface,.f627-root,.f627-external,dialog) :is(.btn,.icon-btn,button.nf-relation) {
    min-height:var(--f627-control-height)!important;
    height:auto!important;
    padding:6px 10px!important;
    font-size:12px!important;
    line-height:1.4!important;
    border-radius:6px!important;
    gap:6px;
  }
  html[data-interface567] :is(form,.f627-surface,.f627-root,.f627-external,dialog) .icon-btn {min-width:var(--f627-control-height)!important;}
  html[data-interface567] :is(form,.f627-surface,.f627-root,.f627-external,dialog) .nf-relation {
    align-items:center;
    height:auto;
    text-align:left;
  }
  html[data-interface567] :is(form,.f627-surface,.f627-root,.f627-external,dialog) :is(.nf-relation span,label) {overflow-wrap:anywhere;}
  html[data-interface567] :is(form,.f627-surface,.f627-root,.f627-external,dialog) :is(.nf-field>span,.nf-field>small) {margin:0;line-height:1.4;}
  html[data-interface567] :is(form,.f627-surface,.f627-root,.f627-external,dialog) .nf-field>span {font-size:12px;gap:4px;}
  html[data-interface567] :is(form,.f627-surface,.f627-root,.f627-external,dialog) :is(.nf-field>small,.f517-date,.i518-hint,.i518-error) {font-size:11px;line-height:1.4;margin-top:3px;}
  html[data-interface567] :is(form,.f627-surface,.f627-root,.f627-external,dialog) :is(.nf-form-grid,.c12-grid,.rec49-grid,.pay48-rule-grid,.s11-grid,.cf514-form-grid,.cpu527-grid,.ed618-form-grid,.dept-form,.fl26-grid-custom) {
    gap:var(--f627-grid-gap)!important;
    align-items:start;
  }
  html[data-interface567] :is(form,.f627-surface,.f627-root,.f627-external,dialog) :is(.nf-field,.nf-coords,.nf-form-grid>*):not([hidden]) {min-width:0;}
  html[data-interface567] :is(form,.f627-surface,.f627-root,.f627-external,dialog) .nf-coords {gap:8px;}

  /* Keep the existing drawer widths; reclaim vertical space around fields. */
  html[data-interface567] #modal:is(.f517-drawer,.f586-editor)>.modal-header {padding:13px 18px;min-height:70px;gap:10px;}
  html[data-interface567] #modal:is(.f517-drawer,.f586-editor)>.modal-header h2 {font-size:20px;line-height:1.25;}
  html[data-interface567] #modal:is(.f517-drawer,.f586-editor)>.modal-header small {font-size:12px;margin-top:3px;}
  html[data-interface567] #modal:is(.f517-drawer,.f586-editor)>.modal-body {padding:14px 18px 18px;scroll-padding-block:58px 14px;}
  html[data-interface567] #modal:is(.f517-drawer,.f586-editor)>.modal-footer {padding:10px 18px calc(10px + env(safe-area-inset-bottom));gap:8px;}
  html[data-interface567] #modal:is(.f517-drawer,.f586-editor) :is(.f517-essentials,.nf-questionnaire,.nf-lines) {padding:12px;border-radius:8px;margin-block:10px;}
  html[data-interface567] #modal:is(.f517-drawer,.f586-editor) .nf-fixed,
  html[data-interface567] #modal:is(.f517-drawer,.f586-editor) .nf-disabled {padding:7px 9px;border-radius:6px;font-size:12px;line-height:1.4;}
  html[data-interface567] #modal:is(.f517-drawer,.f586-editor) .nf-line {padding:9px 0;gap:8px;}
  html[data-interface567] #modal:is(.f517-drawer,.f586-editor) .f586-section-heading {padding-bottom:10px;gap:8px;}
  html[data-interface567] #modal:is(.f517-drawer,.f586-editor) .f586-section-heading h3 {font-size:14px;}
  html[data-interface567] #modal:is(.f517-drawer,.f586-editor) .f586-section-heading>.f586-icon {width:28px;height:28px;border-radius:7px;}
  html[data-interface567] #modal:is(.f517-drawer,.f586-editor) .f517-details {margin-top:10px;border-radius:8px;}
  html[data-interface567] #modal:is(.f517-drawer,.f586-editor) .f517-details>summary {min-height:34px;padding:8px 10px;font-size:12px;}
  html[data-interface567] #modal:is(.f517-drawer,.f586-editor) .f517-details>.f517-section-body {padding:10px;}
  html[data-interface567] :is(.cf622-state,.f517-context,.i518-summary,.pc626-notice,.pc626-machine) {padding:8px 10px;margin-block:0 10px;border-radius:7px;font-size:12px;line-height:1.4;}
  html[data-interface567] .cf622-form {gap:8px;}
  html[data-interface567] .cf622-section {border-radius:8px;border-color:var(--f627-line);}
  html[data-interface567] .cf622-section-content {padding:0 12px 12px;}
  html[data-interface567] .cf622-help {margin:9px 0 10px;font-size:11px;line-height:1.4;}
  html[data-interface567] :is(.fl26-launchbar,.ai624-entry) {padding:7px 10px;margin-bottom:8px;gap:8px;border-radius:7px;font-size:11px;}
  html[data-interface567] .pc626-editor-context {font-size:12px;margin-bottom:8px;}
  html[data-interface567] .pc626-editor-context p {margin-block:4px;line-height:1.4;}
  html[data-interface567] .pc626-fiscal-entry {gap:7px;margin-block:8px;}
  html[data-interface567] .ux667-form-help {gap:10px!important;margin-block:8px!important;font-size:11px!important;}

  /* Horizontal tabs use the same semantic palette in light and both dark themes. */
  .f627-form {min-width:0;}
  .f627-tabs {
    position:sticky;
    top:0;
    z-index:4;
    display:flex;
    align-items:stretch;
    flex-wrap:nowrap;
    overflow-x:auto;
    overscroll-behavior-inline:contain;
    scrollbar-width:thin;
    gap:4px;
    padding:5px;
    margin:0 0 12px;
    border:1px solid var(--f627-line);
    border-radius:8px;
    background:var(--f627-surface);
    color:var(--f627-text);
    scroll-padding-inline:5px;
  }
  html[data-interface567] .f627-tabs .f627-tab {
    appearance:none;
    flex:0 0 auto;
    min-height:34px!important;
    border:1px solid transparent;
    border-radius:5px!important;
    background:transparent;
    color:var(--f627-muted);
    font:inherit;
    font-size:12px!important;
    font-weight:600;
    line-height:1.3;
    padding:7px 10px!important;
    white-space:nowrap;
    cursor:pointer;
  }
  html[data-interface567] .f627-tabs .f627-tab:hover:not(:disabled) {background:var(--u598-hover,#edf2f5);color:var(--f627-text);}
  html[data-interface567] .f627-tabs .f627-tab[aria-selected="true"] {background:var(--f627-selected);color:var(--f627-selected-text);border-color:var(--u598-selected-border,#88aeb4);}
  html[data-interface567] .f627-tabs .f627-tab:disabled {opacity:.6;cursor:default;}
  .f627-tab:focus-visible,.f627-nav button:focus-visible {outline:2px solid var(--f627-focus)!important;outline-offset:2px;}
  .f627-panel {min-width:0;scroll-margin-top:58px;}
  .f627-panel:focus {outline:none;}
  .f627-panel>.f517-essentials {margin-top:0!important;}
  .f627-inactive,.f627-final-hidden,.f627-original-heading,.f627-unavailable {display:none!important;}
  .f627-panel:is(.cf622-section,.f517-details) {margin-top:0!important;}
  .f627-panel:is(.cf622-section,.f517-details)>summary.f627-original-heading {display:none!important;}
  .f627-nav {display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;gap:8px;min-width:0;}
  .f627-nav:only-child {width:100%;}
  .f627-adapter-actions {display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;gap:8px;margin-top:12px;}
  .f627-adapter-grid {min-width:0;}
  .f627-existing-tabs {gap:4px;}
  .f627-progress {font-size:11px;color:var(--f627-muted);line-height:1.4;margin:0 0 8px;white-space:normal;overflow-wrap:anywhere;}
  .f627-prev,.f627-next {white-space:nowrap;}
  .f627-step-error,.f627-step-message:not(:empty) {margin:0 0 10px;padding:8px 10px;border:1px solid var(--u598-danger-border,#e4bdc6);border-radius:7px;background:var(--u598-danger-soft,#faedf0);color:var(--u598-danger,#aa3546);font-size:12px;line-height:1.4;}
  .f627-step-message:empty {display:none;}

  /* Inline worksheets already have dense rows. */
  html[data-interface567] :is(form,.f627-surface,.f627-root,.f627-external) table :is(input:not([type="checkbox"]):not([type="radio"]),select,.btn) {min-height:28px!important;height:auto!important;padding:4px 6px!important;font-size:12px!important;}
  html[data-interface567] :is(form,.f627-surface,.f627-root,.f627-external) table textarea {min-height:48px!important;}
}

@media screen and (max-width:700px),screen and (pointer:coarse) {
  :root {--f627-control-height:44px;--f627-control-font:16px;--f627-control-padding:8px 10px;--f627-grid-gap:10px;--f627-textarea-height:76px;}
  html[data-interface567] :is(form,.f627-surface,.f627-root,.f627-external,dialog) :is(.btn,.icon-btn,button.nf-relation) {font-size:13px!important;}
  html[data-interface567] :is(form,.f627-surface,.f627-root,.f627-external,dialog) :is(input[type="checkbox"],input[type="radio"]) {width:20px;height:20px;min-height:20px;}
  html[data-interface567] #modal:is(.f517-drawer,.f586-editor)>.modal-header {padding:10px 12px calc(10px + env(safe-area-inset-top));min-height:64px;}
  html[data-interface567] #modal:is(.f517-drawer,.f586-editor)>.modal-header h2 {font-size:19px;}
  html[data-interface567] #modal:is(.f517-drawer,.f586-editor)>.modal-body {padding:10px 12px 14px;}
  html[data-interface567] #modal:is(.f517-drawer,.f586-editor)>.modal-footer {padding:8px 12px calc(8px + env(safe-area-inset-bottom));gap:6px;}
  html[data-interface567] .f627-tabs .f627-tab {min-height:44px!important;padding-inline:10px!important;}
  .f627-tabs {margin-bottom:10px;border-radius:7px;}
  .f627-nav {flex:1 1 auto;gap:6px;}
  .f627-nav .f627-progress {flex:1 0 100%;margin:0;text-align:right;}
  .f627-nav :is(.f627-prev,.f627-next) {flex:1 1 auto;}
  html[data-interface567] :is(form,.f627-surface,.f627-root,.f627-external) table :is(input:not([type="checkbox"]):not([type="radio"]),select,.btn) {min-height:44px!important;padding:7px 8px!important;font-size:16px!important;}
}

@media print {
  .f627-tabs,.f627-nav {display:none!important;}
  .f627-inactive:not([hidden]) {display:revert!important;}
  .f627-original-heading {display:revert!important;}
}
