/* ============================================================================
   "AI Import Wizard" (Admin.view.main.AiImportWizard).

   Implements the design handoff "AI Import Wizard (Admin Tool v0.8)" with its five
   steps Tables / Sample / Keys / ObjectTree / Import. The modal is rendered as one
   block of HTML by Admin.view.main.AiImportWizardController - this file styles it
   completely, the Ext window underneath only contributes its positioning and its
   modal mask.

   The whole modal is one flex column: header and footer keep their height, the body
   takes the rest and every step lets exactly one list scroll inside it - never the
   body itself and never two lists at once.

   Design tokens identical to tablewindow-redesign.css / connections-redesign.css.
   ============================================================================ */

body.xadmintool .x-window.aiw-window {
    /* ---- design tokens of the handoff ---- */
    --aiw-white: #FFFFFF;
    --aiw-slate-50: #F8F9FA;
    --aiw-slate-100: #F2F4F6;
    --aiw-slate-200: #E7EAED;
    --aiw-slate-300: #D2D7DC;
    --aiw-slate-400: #B4BCC4;
    --aiw-slate-500: #97A2AD;
    --aiw-slate-600: #7E8B99;
    --aiw-slate-700: #55606C;
    --aiw-slate-800: #3C454F;
    --aiw-slate-900: #2A3138;

    --aiw-teal-50: #F1FBFA;
    --aiw-teal-100: #E4F6F5;
    --aiw-teal-200: #C0EAE7;
    --aiw-teal-300: #93DBD6;
    --aiw-teal-400: #68CCC6;
    --aiw-teal-500: #589999;
    --aiw-teal-600: #4A8686;
    --aiw-teal-700: #3F7373;

    --aiw-plum-100: #E4D9E2;
    --aiw-plum-700: #4A2F49;

    --aiw-warn-bg: #FFF6E5;
    --aiw-warn-border: #F0C98A;
    --aiw-warn-fg: #8A6410;
    --aiw-warn-icon: #B3541E;

    --aiw-xattr: #C0392B;

    --aiw-danger: #C0392B;
    --aiw-danger-bg: #FDF2F0;
    --aiw-danger-border: #E9BDB7;

    --aiw-focus-ring: rgba(88, 153, 153, .55);

    --aiw-font-head: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --aiw-font-body: 'Mulish', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --aiw-font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

    background: var(--aiw-white);
    border: none;
    border-radius: 22px;
    box-shadow: 0 24px 60px rgba(42, 49, 56, .35);
    overflow: hidden;
    font-family: var(--aiw-font-body);
}

body.xadmintool .x-window.aiw-window > .x-window-body,
body.xadmintool .x-window.aiw-window .x-autocontainer-outerCt,
body.xadmintool .x-window.aiw-window .x-autocontainer-innerCt {
    background: transparent;
    border: none;
    padding: 0;
}

/* the modal is laid out in border boxes throughout - the flex columns below hand out
   the height that is left, and a padding that grows on top of it breaks every one of
   them (Ext does not set box-sizing on the plain markup we render into the container) */
body.xadmintool .aiw-window .aiwRootEl,
body.xadmintool .aiw-window .aiwRootEl *,
body.xadmintool .aiw-window .aiwMenu,
body.xadmintool .aiw-window .aiwMenu * {
    box-sizing: border-box;
}

/* the modal shell: header / body / footer, the body takes what is left */
body.xadmintool .aiw-window .aiwRootEl {
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* the overlay of the handoff: rgba(42,49,56,.55) + blur */
body.aiw-modal-open .x-mask {
    background: rgba(42, 49, 56, .55);
    opacity: 1;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

/* ----------------------------------------------------------------------------
   Header: icon tile, title, table count, close button and the stepper
   ---------------------------------------------------------------------------- */
body.xadmintool .aiw-window .aiwHeader {
    flex: none;
    padding: 22px 28px 16px;
    border-bottom: 1px solid var(--aiw-slate-200);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

body.xadmintool .aiw-window .aiwHeaderRow {
    display: flex;
    align-items: center;
    gap: 10px;
}

body.xadmintool .aiw-window .aiwHeaderTile {
    width: 30px;
    height: 30px;
    flex: none;
    border-radius: 9px;
    background: var(--aiw-teal-500);
    color: var(--aiw-white);
    display: flex;
    align-items: center;
    justify-content: center;
}
body.xadmintool .aiw-window .aiwHeaderTile .aiwIcon {
    width: 17px;
    height: 17px;
}

body.xadmintool .aiw-window .aiwHeaderTitle {
    font-family: var(--aiw-font-head);
    font-size: 16px;
    font-weight: 600;
    color: var(--aiw-slate-900);
}

body.xadmintool .aiw-window .aiwHeaderSub {
    font-size: 13px;
    color: var(--aiw-slate-600);
}

body.xadmintool .aiw-window .aiwSpacer {
    flex: 1;
}

body.xadmintool .aiw-window .aiwClose {
    width: 30px;
    height: 30px;
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: var(--aiw-slate-500);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    transition: background-color 140ms ease, color 140ms ease;
}
body.xadmintool .aiw-window .aiwClose:hover {
    background: var(--aiw-slate-100);
    color: var(--aiw-slate-800);
}

body.xadmintool .aiw-window .aiwStepper {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

body.xadmintool .aiw-window .aiwChip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px 6px 8px;
    border-radius: 999px;
    border: 1px solid transparent;
    cursor: pointer;
    user-select: none;
    transition: background-color 140ms ease, border-color 140ms ease;
}

body.xadmintool .aiw-window .aiwChipActive {
    background: var(--aiw-teal-50);
    border-color: var(--aiw-teal-300);
}

body.xadmintool .aiw-window .aiwChipLocked {
    opacity: .55;
    cursor: default;
}

body.xadmintool .aiw-window .aiwChipDot {
    width: 22px;
    height: 22px;
    flex: none;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--aiw-font-head);
    font-size: 12px;
    font-weight: 700;
    background: var(--aiw-slate-100);
    color: var(--aiw-slate-600);
}

body.xadmintool .aiw-window .aiwChipActive .aiwChipDot {
    background: var(--aiw-teal-500);
    color: var(--aiw-white);
}

body.xadmintool .aiw-window .aiwChipDone .aiwChipDot {
    background: var(--aiw-teal-100);
    color: var(--aiw-teal-700);
}

body.xadmintool .aiw-window .aiwChipLabel {
    font-size: 13px;
    font-weight: 500;
    color: var(--aiw-slate-600);
    white-space: nowrap;
}

body.xadmintool .aiw-window .aiwChipActive .aiwChipLabel {
    font-weight: 700;
    color: var(--aiw-slate-900);
}

/* ----------------------------------------------------------------------------
   Body and the shell of one step
   ---------------------------------------------------------------------------- */
body.xadmintool .aiw-window .aiwBody {
    flex: 1;
    min-height: 0;
    padding: 24px 28px;
    display: flex;
    flex-direction: column;
}

body.xadmintool .aiw-window .aiwStep {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

body.xadmintool .aiw-window .aiwTitleBlock {
    flex: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

body.xadmintool .aiw-window .aiwTitle {
    font-family: var(--aiw-font-head);
    font-size: 23px;
    font-weight: 600;
    letter-spacing: -.01em;
    color: var(--aiw-slate-900);
}

body.xadmintool .aiw-window .aiwSub {
    font-size: 14px;
    line-height: 1.55;
    color: var(--aiw-slate-700);
}

/* The one sentence of step 2 that is not an explanation but a promise. It used to
   sit in bold at the end of the paragraph above, where it was read last or not at
   all - on a line of its own with a mark in front of it, it is the first thing the
   eye finds in the step. */
body.xadmintool .aiw-window .aiwPrivacy {
    display: flex;
    align-items: center;
    gap: 10px;
    /* inside the title block now - its own gap does the spacing */
    margin: 2px 0;
    padding: 8px 12px;
    border: 1px solid var(--aiw-teal-200);
    border-left: 3px solid var(--aiw-teal-600);
    border-radius: 10px;
    background: var(--aiw-teal-50);
}

body.xadmintool .aiw-window .aiwPrivacyMark {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 9px;
    background: var(--aiw-teal-600);
    color: var(--aiw-white);
}
body.xadmintool .aiw-window .aiwPrivacyMark .aiwIcon {
    width: 16px;
    height: 16px;
}

body.xadmintool .aiw-window .aiwPrivacyText {
    font-family: var(--aiw-font-head);
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.45;
    color: var(--aiw-teal-700);
}

body.xadmintool .aiw-window .aiwAccent {
    color: var(--aiw-teal-500);
}

body.xadmintool .aiw-window .aiwTitleRow {
    display: flex;
    align-items: center;
    gap: 10px;
}

body.xadmintool .aiw-window .aiwCheckCircle {
    width: 24px;
    height: 24px;
    flex: none;
    border-radius: 999px;
    background: var(--aiw-teal-500);
    color: var(--aiw-white);
    display: flex;
    align-items: center;
    justify-content: center;
}
body.xadmintool .aiw-window .aiwCheckCircle .aiwIcon {
    width: 14px;
    height: 14px;
}

body.xadmintool .aiw-window .aiwIcon {
    width: 15px;
    height: 15px;
    flex: none;
    display: inline-block;
    vertical-align: middle;
}

/* ----------------------------------------------------------------------------
   The card every step lists into - the only element that scrolls
   ---------------------------------------------------------------------------- */
body.xadmintool .aiw-window .aiwCard {
    flex: 1;
    min-height: 0;
    min-width: 0;
    border: 1px solid var(--aiw-slate-200);
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

body.xadmintool .aiw-window .aiwCardHead {
    flex: none;
    padding: 10px 14px;
    border-bottom: 1px solid var(--aiw-slate-200);
    background: var(--aiw-slate-50);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

body.xadmintool .aiw-window .aiwCardHeadStacked {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}

body.xadmintool .aiw-window .aiwCardLabel {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--aiw-slate-600);
    white-space: nowrap;
}

body.xadmintool .aiw-window .aiwCardMeta {
    font-size: 12px;
    color: var(--aiw-slate-600);
}

body.xadmintool .aiw-window .aiwCardTools {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

body.xadmintool .aiw-window .aiwSelectedCount {
    font-size: 12px;
    color: var(--aiw-slate-600);
    white-space: nowrap;
}

body.xadmintool .aiw-window .aiwCardList {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

/* the small pills of the card headers ("Select all", the sample presets) */
body.xadmintool .aiw-window .aiwPill {
    font-size: 12px;
    font-weight: 600;
    color: var(--aiw-slate-700);
    background: var(--aiw-white);
    border: 1px solid var(--aiw-slate-300);
    border-radius: 999px;
    padding: 3px 10px;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    transition: background-color 140ms ease, border-color 140ms ease;
}
body.xadmintool .aiw-window .aiwPill:hover {
    background: var(--aiw-slate-100);
}

body.xadmintool .aiw-window .aiwPillTeal {
    color: var(--aiw-teal-600);
    background: var(--aiw-teal-50);
    border-color: var(--aiw-teal-200);
}
body.xadmintool .aiw-window .aiwPillTeal:hover {
    background: var(--aiw-teal-100);
}

body.xadmintool .aiw-window .aiwPillOutline {
    color: var(--aiw-teal-600);
    background: var(--aiw-white);
    border-color: var(--aiw-teal-300);
    padding: 4px 12px;
}

/* ----------------------------------------------------------------------------
   Step 1 - the table list
   ---------------------------------------------------------------------------- */
body.xadmintool .aiw-window .aiwTableRow {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    border-bottom: 1px solid var(--aiw-slate-100);
    cursor: pointer;
}
body.xadmintool .aiw-window .aiwTableRow:last-child {
    border-bottom: none;
}
body.xadmintool .aiw-window .aiwTableRow:hover {
    background: var(--aiw-slate-50);
}

body.xadmintool .aiw-window .aiwTableRow input {
    width: 15px;
    height: 15px;
    flex: none;
    margin: 0;
    accent-color: var(--aiw-teal-500);
    cursor: pointer;
}

body.xadmintool .aiw-window .aiwTableName {
    flex: 1;
    min-width: 0;
    font-size: 13px;
    color: var(--aiw-slate-800);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ----------------------------------------------------------------------------
   Step 2 - one slider per table
   ---------------------------------------------------------------------------- */
body.xadmintool .aiw-window .aiwSampleRow {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    border-bottom: 1px solid var(--aiw-slate-100);
}
body.xadmintool .aiw-window .aiwSampleRow:last-child {
    border-bottom: none;
}

body.xadmintool .aiw-window .aiwSampleName {
    flex: 1;
    min-width: 0;
    font-size: 13px;
    color: var(--aiw-slate-800);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.xadmintool .aiw-window .aiwSlider {
    width: 220px;
    flex: none;
    margin: 0;
    accent-color: var(--aiw-teal-500);
    cursor: pointer;
}

body.xadmintool .aiw-window .aiwSampleValue {
    width: 56px;
    flex: none;
    text-align: right;
    font-family: var(--aiw-font-mono);
    font-size: 12.5px;
    color: var(--aiw-slate-700);
}

/* ----------------------------------------------------------------------------
   The progress state between step 2 and step 3, and the error state
   ---------------------------------------------------------------------------- */
body.xadmintool .aiw-window .aiwProgressCard {
    flex: none;
    border: 1px solid var(--aiw-teal-200);
    background: linear-gradient(180deg, var(--aiw-teal-50), var(--aiw-white));
    border-radius: 14px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

body.xadmintool .aiw-window .aiwProgressHead {
    display: flex;
    align-items: center;
    gap: 10px;
}

body.xadmintool .aiw-window .aiwProgressText {
    font-size: 13px;
    color: var(--aiw-slate-800);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.xadmintool .aiw-window .aiwProgressCount {
    font-size: 12px;
    color: var(--aiw-slate-600);
    white-space: nowrap;
}

body.xadmintool .aiw-window .aiwProgressTrack {
    height: 6px;
    border-radius: 999px;
    background: var(--aiw-slate-200);
    overflow: hidden;
}

body.xadmintool .aiw-window .aiwProgressBar {
    height: 100%;
    border-radius: 999px;
    background: var(--aiw-teal-500);
    transition: width 200ms ease;
}

body.xadmintool .aiw-window .aiwSpinner {
    width: 15px;
    height: 15px;
    flex: none;
    border-radius: 999px;
    border: 2px solid var(--aiw-teal-200);
    border-top-color: var(--aiw-teal-500);
    animation: aiwSpin 800ms linear infinite;
}

@keyframes aiwSpin {
    to { transform: rotate(360deg); }
}

/* ----------------------------------------------------------------------------
   Step 3 - the derived keys per table
   ---------------------------------------------------------------------------- */
body.xadmintool .aiw-window .aiwKeyBlock {
    padding: 13px 14px;
    border-bottom: 1px solid var(--aiw-slate-100);
    display: flex;
    flex-direction: column;
    gap: 8px;
}
body.xadmintool .aiw-window .aiwKeyBlock:last-child {
    border-bottom: none;
}

body.xadmintool .aiw-window .aiwKeyTable {
    display: flex;
    align-items: center;
    gap: 9px;
}

body.xadmintool .aiw-window .aiwKeyTableIcon {
    color: var(--aiw-slate-500);
}

body.xadmintool .aiw-window .aiwKeyTableName {
    font-size: 13px;
    font-weight: 700;
    color: var(--aiw-slate-900);
}

body.xadmintool .aiw-window .aiwKeyTableMeta {
    font-size: 12px;
    color: var(--aiw-slate-500);
    white-space: nowrap;
}

/* the loudest element of the step - the handoff wants the user to correct keys */
body.xadmintool .aiw-window .aiwEditKeys {
    flex: none;
    font-family: var(--aiw-font-head);
    font-size: 12px;
    font-weight: 600;
    color: var(--aiw-white);
    background: var(--aiw-teal-500);
    border: 1px solid var(--aiw-teal-500);
    border-radius: 999px;
    padding: 5px 14px;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(88, 153, 153, .28);
    transition: background-color 140ms ease;
}
body.xadmintool .aiw-window .aiwEditKeys:hover {
    background: var(--aiw-teal-600);
}

body.xadmintool .aiw-window .aiwEditKeysOn,
body.xadmintool .aiw-window .aiwEditKeysOn:hover {
    color: var(--aiw-slate-500);
    background: var(--aiw-slate-100);
    border-color: var(--aiw-slate-300);
    box-shadow: none;
    cursor: default;
}

/* "Do not import this table" - quiet next to the loud "Edit keys", it takes something
   away instead of offering something */
/* where the keys came out of the schema there is nothing to edit - this badge
   stands where the "Edit keys" button stands for every other table */
body.xadmintool .aiw-window .aiwFromDb {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 28px;
    box-sizing: border-box;
    padding: 0 12px;
    border: 1px solid var(--aiw-teal-200);
    border-radius: 8px;
    background: var(--aiw-teal-50);
    font-size: 12.5px;
    font-weight: 700;
    color: var(--aiw-teal-700);
    white-space: nowrap;
    cursor: default;
}

body.xadmintool .aiw-window .aiwFromDbIcon {
    width: 13px;
    height: 13px;
    color: var(--aiw-teal-600);
}

body.xadmintool .aiw-window .aiwRemoveTable {
    width: 26px;
    height: 26px;
    flex: none;
    border-radius: 8px;
    border: 1px solid var(--aiw-slate-300);
    background: var(--aiw-white);
    color: var(--aiw-slate-500);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
    transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}
body.xadmintool .aiw-window .aiwRemoveTable:hover {
    border-color: var(--aiw-danger-border);
    background: var(--aiw-danger-bg);
    color: var(--aiw-danger);
}
body.xadmintool .aiw-window .aiwRemoveTable .aiwIcon {
    width: 14px;
    height: 14px;
}

body.xadmintool .aiw-window .aiwKeyRow {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-left: 24px;
}

body.xadmintool .aiw-window .aiwKeyEmpty {
    font-size: 12.5px;
    color: var(--aiw-slate-500);
}

body.xadmintool .aiw-window .aiwKeyBlock.aiwKeyEmpty {
    padding: 18px 14px;
}

body.xadmintool .aiw-window .aiwKind {
    flex: none;
    min-width: 24px;
    text-align: center;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .06em;
    border-radius: 5px;
    padding: 2px 6px;
}

body.xadmintool .aiw-window .aiwKindPk {
    color: var(--aiw-plum-700);
    background: var(--aiw-plum-100);
}

body.xadmintool .aiw-window .aiwKindFk {
    color: var(--aiw-slate-700);
    background: var(--aiw-slate-100);
}

body.xadmintool .aiw-window .aiwKeyColumn {
    font-family: var(--aiw-font-mono);
    font-size: 12.5px;
    color: var(--aiw-slate-800);
}

body.xadmintool .aiw-window .aiwKeyTarget {
    font-size: 12.5px;
    color: var(--aiw-slate-600);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* the confidence is intentionally quiet - plain text, never a chip */
body.xadmintool .aiw-window .aiwConfidence {
    flex: none;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

/* the two switches in the header of a table (#renderForceSwitch): quiet outlines
   until the user turns one on, then the accent - they overrule the derivation, so
   they have to be visible at a glance across the whole list */
body.xadmintool .aiw-window .aiwForce {
    flex: none;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .02em;
    color: var(--aiw-slate-600);
    background: var(--aiw-white);
    border: 1px solid var(--aiw-slate-300);
    border-radius: 999px;
    padding: 2px 9px;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}
body.xadmintool .aiw-window .aiwForce:hover {
    border-color: var(--aiw-slate-400);
    color: var(--aiw-slate-800);
}

body.xadmintool .aiw-window .aiwForceOn,
body.xadmintool .aiw-window .aiwForceOn:hover {
    color: var(--aiw-white);
    background: var(--aiw-slate-700);
    border-color: var(--aiw-slate-700);
}

/* the rejected candidates below a table without a key (#renderNearMisses): the same
   row, but visibly not a key - no chip colour, no full contrast */
body.xadmintool .aiw-window .aiwNearHead {
    padding: 2px 8px 4px 34px;
    font-size: 11.5px;
    color: var(--aiw-slate-500);
}

body.xadmintool .aiw-window .aiwKeyNear .aiwKeyColumn,
body.xadmintool .aiw-window .aiwKeyNear .aiwKeyTarget {
    color: var(--aiw-slate-500);
}

body.xadmintool .aiw-window .aiwKindNear {
    color: var(--aiw-slate-500);
    background: transparent;
    border: 1px dashed var(--aiw-slate-300);
}

body.xadmintool .aiw-window .aiwConfNear {
    color: var(--aiw-slate-500);
    font-weight: 400;
}

body.xadmintool .aiw-window .aiwConfHigh {
    color: var(--aiw-slate-500);
}

body.xadmintool .aiw-window .aiwConfCheck {
    color: var(--aiw-warn-fg);
}

/* the note below the list - a quiet line, or the warning box of a broken rule */
body.xadmintool .aiw-window .aiwNote {
    flex: none;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 13px;
    line-height: 1.5;
    color: var(--aiw-slate-700);
}

body.xadmintool .aiw-window .aiwNoteIcon {
    margin-top: 2px;
    color: var(--aiw-slate-500);
}

body.xadmintool .aiw-window .aiwNoteLines {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

/* the quiet good news: the database delivered everything, nothing to check */
body.xadmintool .aiw-window .aiwNoteOk {
    border-color: var(--aiw-teal-200);
    background: var(--aiw-teal-50);
    color: var(--aiw-teal-700);
}
body.xadmintool .aiw-window .aiwNoteOk .aiwNoteIcon {
    color: var(--aiw-teal-600);
}

body.xadmintool .aiw-window .aiwNoteWarn {
    padding: 10px 12px;
    border: 1px solid var(--aiw-warn-border);
    background: var(--aiw-warn-bg);
    border-radius: 10px;
    color: var(--aiw-warn-fg);
}
body.xadmintool .aiw-window .aiwNoteWarn .aiwNoteIcon {
    color: var(--aiw-warn-icon);
}

body.xadmintool .aiw-window .aiwCheck {
    color: var(--aiw-warn-fg);
    font-weight: 700;
}

/* ----------------------------------------------------------------------------
   Step 3 - the same keys as a graph (Admin.view.main.AiImportWizardController
   #renderKeyGraph): tables as nodes, foreign keys as arrows. The drawing keeps
   its own size and scrolls inside the card, the card keeps the height of the
   step like the list does.
   ---------------------------------------------------------------------------- */
body.xadmintool .aiw-window .aiwGraphScroll {
    flex: 1;
    min-height: 0;
    overflow: auto;
    padding: 6px;
    background:
        radial-gradient(circle, var(--aiw-slate-200) 1px, transparent 1.2px) 0 0 / 18px 18px;
}

body.xadmintool .aiw-window .aiwGraph {
    display: block;
    margin: 0 auto;
    overflow: visible;
}

/* ---- the nodes ---- */
body.xadmintool .aiw-window .aiwGraph .aiwGraphBox {
    fill: var(--aiw-white);
    stroke: var(--aiw-slate-300);
    stroke-width: 1;
}

body.xadmintool .aiw-window .aiwGraph .aiwGraphNode:hover .aiwGraphBox {
    stroke: var(--aiw-teal-500);
}

body.xadmintool .aiw-window .aiwGraph .aiwGraphNodeNoPk .aiwGraphBox {
    stroke: var(--aiw-slate-300);
    stroke-dasharray: 4 3;
}

body.xadmintool .aiw-window .aiwGraph .aiwGraphName {
    font-family: var(--aiw-font-head);
    font-size: 13px;
    font-weight: 600;
    fill: var(--aiw-slate-900);
}

body.xadmintool .aiw-window .aiwGraph .aiwGraphKey {
    font-family: var(--aiw-font-mono);
    font-size: 11px;
    fill: var(--aiw-plum-700);
}

body.xadmintool .aiw-window .aiwGraph .aiwGraphKeyNone {
    font-family: var(--aiw-font-body);
    font-style: italic;
    fill: var(--aiw-slate-500);
}

/* ---- the edges ---- */
body.xadmintool .aiw-window .aiwGraph .aiwGraphLine {
    fill: none;
    stroke: var(--aiw-teal-500);
    stroke-width: 1.6;
}

body.xadmintool .aiw-window .aiwGraph .aiwGraphHead {
    fill: var(--aiw-teal-500);
    stroke: none;
}

/* a key the user should look at is drawn the way step 3 flags it: dashed and in
   the warning colour of the "Check" badge */
body.xadmintool .aiw-window .aiwGraph .aiwGraphEdgeCheck .aiwGraphLine {
    stroke: var(--aiw-warn-icon);
    stroke-dasharray: 5 4;
}

body.xadmintool .aiw-window .aiwGraph .aiwGraphHeadCheck {
    fill: var(--aiw-warn-icon);
    stroke: none;
}

body.xadmintool .aiw-window .aiwGraph .aiwGraphEdge:hover .aiwGraphLine {
    stroke-width: 2.4;
}

/* the column the foreign key sits on, written onto the line - the halo keeps it
   readable where the line runs underneath it */
body.xadmintool .aiw-window .aiwGraph .aiwGraphLabel {
    font-family: var(--aiw-font-mono);
    font-size: 10.5px;
    fill: var(--aiw-slate-700);
    text-anchor: middle;
    dominant-baseline: middle;
    paint-order: stroke;
    stroke: var(--aiw-white);
    stroke-width: 4;
    stroke-linejoin: round;
}

body.xadmintool .aiw-window .aiwGraph .aiwGraphEdgeCheck .aiwGraphLabel {
    fill: var(--aiw-warn-fg);
}

/* ----------------------------------------------------------------------------
   Step 3 - the inline key editor
   ---------------------------------------------------------------------------- */
body.xadmintool .aiw-window .aiwEditor {
    margin-left: 24px;
    border: 1px solid var(--aiw-teal-200);
    background: var(--aiw-teal-50);
    border-radius: 12px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

body.xadmintool .aiw-window .aiwEdHead {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--aiw-slate-600);
}

body.xadmintool .aiw-window .aiwEdRow {
    display: flex;
    align-items: center;
    gap: 10px;
}

body.xadmintool .aiw-window .aiwEdKind {
    width: 74px;
    flex: none;
}

body.xadmintool .aiw-window .aiwEdColumn {
    width: 170px;
    flex: none;
}

body.xadmintool .aiw-window .aiwEdRef {
    flex: 1;
    min-width: 0;
}

body.xadmintool .aiw-window .aiwEdRemove {
    width: 26px;
    height: 26px;
    flex: none;
    border-radius: 8px;
    border: 1px solid var(--aiw-slate-300);
    background: var(--aiw-white);
    color: var(--aiw-slate-600);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    cursor: pointer;
    user-select: none;
}
body.xadmintool .aiw-window .aiwEdRemove:hover {
    background: var(--aiw-slate-100);
    color: var(--aiw-slate-800);
}

body.xadmintool .aiw-window .aiwEdActions {
    display: flex;
    align-items: center;
    gap: 10px;
}

body.xadmintool .aiw-window .aiwEdCancel {
    font-size: 12px;
    font-weight: 600;
    color: var(--aiw-slate-700);
    cursor: pointer;
    user-select: none;
}
body.xadmintool .aiw-window .aiwEdCancel:hover {
    text-decoration: underline;
}

body.xadmintool .aiw-window .aiwEdDone {
    font-size: 12px;
    font-weight: 600;
    color: var(--aiw-white);
    background: var(--aiw-teal-500);
    border-radius: 999px;
    padding: 5px 14px;
    cursor: pointer;
    user-select: none;
    transition: background-color 140ms ease;
}
body.xadmintool .aiw-window .aiwEdDone:hover {
    background: var(--aiw-teal-600);
}

body.xadmintool .aiw-window .aiwEdFooter {
    font-size: 12px;
    line-height: 1.5;
    color: var(--aiw-slate-600);
}

/* the custom dropdowns - a native select cannot be styled to match */
body.xadmintool .aiw-window .aiwSelect {
    height: 32px;
    box-sizing: border-box;
    border-radius: 8px;
    padding: 0 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    border: 1px solid var(--aiw-slate-300);
    background: var(--aiw-white);
    color: var(--aiw-slate-800);
    font-family: var(--aiw-font-mono);
    font-size: 12.5px;
    cursor: pointer;
    user-select: none;
}

body.xadmintool .aiw-window .aiwSelectOpen {
    border-color: var(--aiw-teal-400);
}

body.xadmintool .aiw-window .aiwSelectDisabled {
    background: var(--aiw-slate-100);
    color: var(--aiw-slate-500);
    cursor: default;
}

body.xadmintool .aiw-window .aiwSelectValue {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.xadmintool .aiw-window .aiwSelectCaret {
    width: 14px;
    height: 14px;
    flex: none;
    color: var(--aiw-slate-500);
}

/* the open menu is rendered next to the footer, not inside the scrolling card -
   an absolutely positioned menu is clipped by the card in every variant */
body.xadmintool .aiw-window .aiwMenu {
    position: fixed;
    z-index: 100000;
    box-sizing: border-box;
    overflow-y: auto;
    background: var(--aiw-white);
    border: 1px solid var(--aiw-slate-200);
    border-radius: 10px;
    padding: 4px;
    box-shadow: 0 12px 28px rgba(42, 49, 56, .18);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

body.xadmintool .aiw-window .aiwMenuItem {
    padding: 6px 10px;
    border-radius: 7px;
    font-family: var(--aiw-font-mono);
    font-size: 12.5px;
    color: var(--aiw-slate-800);
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
body.xadmintool .aiw-window .aiwMenuItem:hover {
    background: var(--aiw-slate-100);
}

body.xadmintool .aiw-window .aiwMenuItemOn {
    background: var(--aiw-teal-50);
    color: var(--aiw-teal-700);
    font-weight: 700;
}

/* ----------------------------------------------------------------------------
   Step 4 - root choice on the left, the proposed tree on the right
   ---------------------------------------------------------------------------- */
body.xadmintool .aiw-window .aiwColumns {
    flex: 1;
    min-height: 0;
    display: flex;
    gap: 20px;
    align-items: stretch;
}

body.xadmintool .aiw-window .aiwColRoot {
    width: 290px;
    flex: none;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

body.xadmintool .aiw-window .aiwColTree {
    flex: 1;
    min-width: 0;
}

body.xadmintool .aiw-window .aiwFieldLabel {
    font-size: 13px;
    font-weight: 700;
    color: var(--aiw-slate-800);
}

body.xadmintool .aiw-window .aiwHelp {
    font-size: 12px;
    line-height: 1.5;
    color: var(--aiw-slate-600);
}

/* the root of the tree, over the whole width of the column - it used to be a stack
   of radio cards, which took the room the explanation below now has */
body.xadmintool .aiw-window .aiwRootSelect {
    width: 100%;
    box-sizing: border-box;
    height: 38px;
}
body.xadmintool .aiw-window .aiwRootSelect .aiwSelectValue {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--aiw-slate-900);
}

/* what "Edit Tree" is good for - the three icons are the ones it puts next to the
   rows of the tree, so the block reads as a key to them */
/* the one part of the column that gives way when the modal is short: the label, the
   dropdown and the legend stay where they are and this scrolls instead */
body.xadmintool .aiw-window .aiwEditHelp {
    /* as tall as its text, but the one part of the column that gives way when the
       modal is short - then it scrolls and the dropdown and the legend stay put */
    flex: 0 1 auto;
    min-height: 0;
    overflow-y: auto;
    margin-top: 0;
    padding: 10px 12px;
    border: 1px solid var(--aiw-slate-200);
    border-radius: 12px;
    background: var(--aiw-slate-50);
}

body.xadmintool .aiw-window .aiwEditHelpHead {
    display: flex;
    align-items: center;
    gap: 7px;
    font-family: var(--aiw-font-head);
    font-size: 13px;
    font-weight: 600;
    color: var(--aiw-slate-900);
}

body.xadmintool .aiw-window .aiwEditHelpIcon {
    width: 14px;
    height: 14px;
    color: var(--aiw-teal-600);
}

body.xadmintool .aiw-window .aiwEditHelpBody {
    margin-top: 4px;
    font-size: 12px;
    line-height: 1.5;
    color: var(--aiw-slate-600);
}

body.xadmintool .aiw-window .aiwHelpRow {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin-top: 7px;
}

body.xadmintool .aiw-window .aiwHelpIcon {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 7px;
    border: 1px solid var(--aiw-slate-200);
    background: var(--aiw-white);
    color: var(--aiw-slate-600);
}
body.xadmintool .aiw-window .aiwHelpIcon .aiwIcon {
    width: 12px;
    height: 12px;
}

body.xadmintool .aiw-window .aiwHelpText {
    font-size: 12px;
    line-height: 1.45;
    color: var(--aiw-slate-700);
}

body.xadmintool .aiw-window .aiwLegend {
    flex: none;
    display: flex;
    align-items: center;
    gap: 14px;
    padding-bottom: 2px;
    font-size: 12px;
    color: var(--aiw-slate-600);
}

body.xadmintool .aiw-window .aiwLegendItem {
    display: flex;
    align-items: center;
    gap: 6px;
}

body.xadmintool .aiw-window .aiwLegendIcon {
    width: 13px;
    height: 13px;
    color: var(--aiw-slate-500);
}

body.xadmintool .aiw-window .aiwLegendXattr {
    color: var(--aiw-xattr);
}

/* ---- the toolbar above the proposed tree -------------------------------- */
body.xadmintool .aiw-window .aiwTreeHead {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
}

body.xadmintool .aiw-window .aiwTreeHeadTop {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-width: 0;
}

body.xadmintool .aiw-window .aiwTreeTools {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    flex-wrap: wrap;
}

body.xadmintool .aiw-window .aiwToolSep {
    flex: none;
    width: 1px;
    height: 18px;
    margin: 0 4px;
    background: var(--aiw-slate-200);
}

body.xadmintool .aiw-window .aiwIconBtn {
    flex: none;
    width: 30px;
    height: 30px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--aiw-slate-200);
    border-radius: 9px;
    background: var(--aiw-white);
    color: var(--aiw-slate-600);
    cursor: pointer;
    transition: background-color 140ms ease, color 140ms ease;
}
body.xadmintool .aiw-window .aiwIconBtn:hover {
    background: var(--aiw-slate-100);
    color: var(--aiw-slate-800);
}

/* nothing left to take back, or nothing left to restore */
body.xadmintool .aiw-window .aiwIconBtnDisabled,
body.xadmintool .aiw-window .aiwIconBtnDisabled:hover {
    opacity: .4;
    cursor: default;
    background: var(--aiw-white);
    color: var(--aiw-slate-600);
}

body.xadmintool .aiw-window .aiwToolBtn {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 30px;
    box-sizing: border-box;
    padding: 0 12px;
    border: 1px solid var(--aiw-slate-200);
    border-radius: 9px;
    background: var(--aiw-white);
    font-family: var(--aiw-font-body);
    font-size: 12.5px;
    font-weight: 700;
    color: var(--aiw-slate-700);
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 140ms ease, color 140ms ease, border-color 140ms ease;
}
body.xadmintool .aiw-window .aiwToolBtn:hover {
    background: var(--aiw-slate-100);
}

body.xadmintool .aiw-window .aiwToolBtnEdit {
    border-color: var(--aiw-teal-300);
    background: var(--aiw-teal-50);
    color: var(--aiw-teal-700);
}
body.xadmintool .aiw-window .aiwToolBtnEdit:hover {
    background: var(--aiw-teal-100);
}

/* "Edit Tree" stays pressed while the actions sit next to the rows */
body.xadmintool .aiw-window .aiwToolBtnOn,
body.xadmintool .aiw-window .aiwToolBtnOn:hover {
    border-color: var(--aiw-teal-600);
    background: var(--aiw-teal-600);
    color: var(--aiw-white);
}

body.xadmintool .aiw-window .aiwToolIcon {
    width: 14px;
    height: 14px;
    flex: none;
}

body.xadmintool .aiw-window .aiwTreeError {
    flex: none;
    margin: 10px 12px 0;
}

body.xadmintool .aiw-window .aiwTree {
    padding: 10px 8px;
}

body.xadmintool .aiw-window .aiwTreeRow {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 3px 8px;
    border-radius: 6px;
}

body.xadmintool .aiw-window .aiwTreeIcon {
    width: 13px;
    height: 13px;
    flex: none;
}

/* every row is drawn as [fold][icon][label] - both slots keep their width when they
   are empty, so the rows of one level line up no matter which icon they carry */
body.xadmintool .aiw-window .aiwTreeFold,
body.xadmintool .aiw-window .aiwTreeIconSlot {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 13px;
    height: 13px;
}

body.xadmintool .aiw-window .aiwTreeFold {
    width: 16px;
    height: 16px;
    margin-left: -2px;
    border-radius: 5px;
}

/* only a row that has children carries a chevron, and that chevron is the control
   that folds it - the rest of the row does not react to a click */
body.xadmintool .aiw-window .aiwTreeFoldOn {
    cursor: pointer;
    transition: background-color 140ms ease;
}
body.xadmintool .aiw-window .aiwTreeFoldOn:hover {
    background: var(--aiw-slate-100);
}

/* folded: the chevron points at the rows it hides */
body.xadmintool .aiw-window .aiwTreeIconFolded {
    transform: rotate(-90deg);
}

body.xadmintool .aiw-window .aiwTreeName {
    font-size: 12.5px;
    color: var(--aiw-slate-800);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.xadmintool .aiw-window .aiwTreeNote {
    font-size: 11px;
    color: var(--aiw-slate-500);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.xadmintool .aiw-window .aiwTreeRow-object .aiwTreeIcon {
    color: var(--aiw-teal-600);
}
body.xadmintool .aiw-window .aiwTreeRow-object .aiwTreeName {
    font-family: var(--aiw-font-body);
    font-size: 13px;
    font-weight: 700;
    color: var(--aiw-teal-700);
}

/* a key column is a dimension without an attribute below it and without an icon */
body.xadmintool .aiw-window .aiwTreeRow-key .aiwTreeName {
    font-family: var(--aiw-font-mono);
    font-style: italic;
    color: var(--aiw-slate-500);
}

body.xadmintool .aiw-window .aiwTreeRow-dim .aiwTreeIcon {
    color: var(--aiw-slate-700);
}
body.xadmintool .aiw-window .aiwTreeRow-dim .aiwTreeIconClock {
    color: var(--aiw-slate-500);
}

body.xadmintool .aiw-window .aiwTreeRow-attr .aiwTreeIcon {
    width: 12px;
    height: 12px;
    color: var(--aiw-slate-400);
}
body.xadmintool .aiw-window .aiwTreeRow-attr .aiwTreeName {
    color: var(--aiw-slate-700);
}

body.xadmintool .aiw-window .aiwTreeRow-xattr .aiwTreeIcon {
    width: 12px;
    height: 12px;
    color: var(--aiw-xattr);
}

/* ---- "Edit Tree": the actions at the right edge of a row ---------------- */
body.xadmintool .aiw-window .aiwTreeActions {
    flex: none;
    display: flex;
    align-items: center;
    gap: 2px;
    margin-left: auto;
    padding-left: 8px;
}

body.xadmintool .aiw-window .aiwTreeAct {
    flex: none;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    color: var(--aiw-slate-400);
    cursor: pointer;
    transition: background-color 140ms ease, color 140ms ease;
}
body.xadmintool .aiw-window .aiwTreeAct:hover {
    background: var(--aiw-slate-100);
    color: var(--aiw-slate-800);
}

/* the one action that cannot be taken back by looking at the tree */
body.xadmintool .aiw-window .aiwTreeAct[data-aiw-act="objdel"]:hover,
body.xadmintool .aiw-window .aiwTreeAct[data-aiw-act="xattrdel"]:hover {
    background: var(--aiw-danger-bg);
    color: var(--aiw-danger);
}

body.xadmintool .aiw-window .aiwTreeActIcon {
    width: 13px;
    height: 13px;
}

/* a row that carries actions keeps its hover, so it is clear which row they
   belong to */
body.xadmintool .aiw-window .aiwTree .aiwTreeRow:hover .aiwTreeAct {
    color: var(--aiw-slate-600);
}

/* ----------------------------------------------------------------------------
   Step 5 - the two import options and the consequence box
   ---------------------------------------------------------------------------- */
body.xadmintool .aiw-window .aiwColumnsTop {
    flex: 1;
    min-height: 0;
    align-items: flex-start;
    overflow-y: auto;
}

body.xadmintool .aiw-window .aiwColChecks {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

body.xadmintool .aiw-window .aiwCheckLabel {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--aiw-slate-600);
    margin-bottom: 4px;
}

body.xadmintool .aiw-window .aiwNextBox {
    flex: 1;
    min-width: 0;
    border: 1px solid var(--aiw-teal-200);
    background: linear-gradient(180deg, var(--aiw-teal-50), var(--aiw-white));
    border-radius: 14px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

body.xadmintool .aiw-window .aiwNextTitleLabel {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--aiw-teal-700);
}

body.xadmintool .aiw-window .aiwNextIntro {
    margin-top: -4px;
    font-size: 12.5px;
    line-height: 1.5;
    color: var(--aiw-slate-700);
}

body.xadmintool .aiw-window .aiwNextRow {
    display: flex;
    align-items: flex-start;
    gap: 9px;
}

body.xadmintool .aiw-window .aiwNextText {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

body.xadmintool .aiw-window .aiwNextSub {
    font-size: 11.5px;
    line-height: 1.4;
    color: var(--aiw-slate-600);
}

body.xadmintool .aiw-window .aiwNextMark {
    width: 22px;
    height: 22px;
    flex: none;
    box-sizing: border-box;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--aiw-font-head);
    font-size: 11px;
    font-weight: 700;
    background: var(--aiw-white);
    border: 1px solid var(--aiw-teal-300);
    color: var(--aiw-teal-700);
}

body.xadmintool .aiw-window .aiwNextMarkDone {
    background: var(--aiw-teal-500);
    border-color: var(--aiw-teal-500);
    color: var(--aiw-white);
}

body.xadmintool .aiw-window .aiwNextTitle {
    font-size: 13px;
    font-weight: 600;
    color: var(--aiw-slate-900);
}

body.xadmintool .aiw-window .aiwNextByAgent {
    font-size: 12px;
    font-weight: 400;
    color: var(--aiw-slate-600);
}

/* ----------------------------------------------------------------------------
   Footer: the contextual hint and the two buttons
   ---------------------------------------------------------------------------- */
body.xadmintool .aiw-window .aiwFooter {
    flex: none;
    padding: 16px 28px;
    border-top: 1px solid var(--aiw-slate-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

body.xadmintool .aiw-window .aiwFooterHint {
    font-size: 13px;
    color: var(--aiw-slate-600);
}

body.xadmintool .aiw-window .aiwFooterButtons {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: none;
}

body.xadmintool .aiw-window .aiwBtn {
    height: 40px;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    font-family: var(--aiw-font-head);
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
    transition: background-color 140ms ease, color 140ms ease;
}

body.xadmintool .aiw-window .aiwPrimary {
    padding: 0 24px;
    background: var(--aiw-teal-500);
    color: var(--aiw-white);
    box-shadow: 0 8px 20px rgba(88, 153, 153, .28);
}
body.xadmintool .aiw-window .aiwPrimary:hover {
    background: var(--aiw-teal-600);
}
body.xadmintool .aiw-window .aiwPrimary:active {
    background: var(--aiw-teal-700);
}

body.xadmintool .aiw-window .aiwSecondary {
    padding: 0 20px;
    border: 1px solid var(--aiw-slate-300);
    background: var(--aiw-white);
    color: var(--aiw-slate-700);
}
body.xadmintool .aiw-window .aiwSecondary:hover {
    background: var(--aiw-slate-100);
}

body.xadmintool .aiw-window .aiwBtn.aiwDisabled,
body.xadmintool .aiw-window .aiwBtn.aiwDisabled:hover {
    background: var(--aiw-slate-200);
    color: var(--aiw-slate-500);
    box-shadow: none;
    cursor: not-allowed;
}

/* a disabled "Back" keeps the outline of the secondary button - a filled grey pill
   would read as the loudest element of the footer */
body.xadmintool .aiw-window .aiwSecondary.aiwDisabled,
body.xadmintool .aiw-window .aiwSecondary.aiwDisabled:hover {
    background: var(--aiw-white);
    border-color: var(--aiw-slate-200);
    color: var(--aiw-slate-400);
}

body.xadmintool .aiw-window .aiwHidden {
    visibility: hidden;
}

/* ----------------------------------------------------------------------------
   The launcher card below the table / file list of the left column - the entry
   point of the wizard (Admin.view.main.MainController#updateAiWizardLauncher).

   It carries a red ramp instead of the teal one: the teal actions in that
   column are the import steps the user runs himself, the agent is the
   alternative to them and must not read as one more of them.
   ---------------------------------------------------------------------------- */
body.xadmintool .aiwLauncher {
    --aiwl-bg-top: #FDF6F5;
    --aiwl-bg-bottom: #F7E7E5;
    --aiwl-border: #EFD5D2;
    --aiwl-accent: #A33330;
    --aiwl-accent-hover: #832623;
    --aiwl-title: #832623;
    --aiwl-text: #55606C;
    --aiwl-muted: #7E8B99;

    --aiwl-font-head: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --aiwl-font-body: 'Mulish', system-ui, -apple-system, 'Segoe UI', sans-serif;

    box-sizing: border-box;
    padding: 14px 16px 16px;
    border-top: 1px solid var(--aiwl-border);
    background: linear-gradient(180deg, var(--aiwl-bg-top), var(--aiwl-bg-bottom));
    font-family: var(--aiwl-font-body);
}

body.xadmintool .aiwLauncher .aiwLauncherHead {
    display: flex;
    align-items: center;
    gap: 8px;
}

body.xadmintool .aiwLauncher .aiwIcon {
    width: 15px;
    height: 15px;
    flex: none;
}

body.xadmintool .aiwLauncher .aiwLauncherIcon {
    color: var(--aiwl-accent);
    width: 16px;
    height: 16px;
}

body.xadmintool .aiwLauncher .aiwLauncherTitle {
    font-family: var(--aiwl-font-head);
    font-size: 14px;
    font-weight: 600;
    color: var(--aiwl-title);
}

body.xadmintool .aiwLauncher .aiwLauncherBadge {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #FFFFFF;
    background: var(--aiwl-accent);
    border-radius: 999px;
    padding: 2px 8px;
}

/* the "x" of the card - it hides the card for this session, nothing is stored */
body.xadmintool .aiwLauncher .aiwLauncherClose {
    margin-left: auto;
    width: 22px;
    height: 22px;
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    color: var(--aiwl-muted);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    transition: background-color 140ms ease, color 140ms ease;
}
body.xadmintool .aiwLauncher .aiwLauncherClose:hover {
    background: rgba(163, 51, 48, .10);
    color: var(--aiwl-accent);
}

body.xadmintool .aiwLauncher .aiwLauncherBody {
    margin-top: 8px;
    font-size: 12.5px;
    line-height: 1.5;
    color: var(--aiwl-text);
}

body.xadmintool .aiwLauncher .aiwLauncherActions {
    margin-top: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
}

body.xadmintool .aiwLauncher .aiwLauncherBtn {
    flex: 1;
    min-width: 0;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 16px;
    border-radius: 999px;
    background: var(--aiwl-accent);
    color: #FFFFFF;
    font-family: var(--aiwl-font-head);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
    transition: background-color 140ms ease;
}
body.xadmintool .aiwLauncher .aiwLauncherBtn:hover {
    background: var(--aiwl-accent-hover);
}

body.xadmintool .aiwLauncher .aiwLauncherArrow {
    width: 14px;
    height: 14px;
}

/* ----------------------------------------------------------------------------
   Dark theme (body.oe-theme-dark, see resources/dark-theme.css)
   ---------------------------------------------------------------------------- */
body.oe-theme-dark.xadmintool .x-window.aiw-window,
body.oe-theme-dark .x-window.aiw-window {
    --aiw-white: #22282E;
    --aiw-slate-50: #262D34;
    --aiw-slate-100: #2E353C;
    --aiw-slate-200: #39424A;
    --aiw-slate-300: #46505A;
    --aiw-slate-400: #5A6672;
    --aiw-slate-500: #8593A0;
    --aiw-slate-600: #9AA7B3;
    --aiw-slate-700: #BAC4CD;
    --aiw-slate-800: #D6DDE3;
    --aiw-slate-900: #EDF1F4;

    --aiw-teal-50: #22322F;
    --aiw-teal-100: #2A403C;
    --aiw-teal-200: #37544F;

    --aiw-plum-100: #3B2E3A;
    --aiw-plum-700: #E0CBDA;

    --aiw-warn-bg: #3E3121;
    --aiw-warn-border: #6B5327;
    --aiw-warn-fg: #F0C97A;
    --aiw-warn-icon: #E08A5A;

    --aiw-xattr: #E0705F;

    --aiw-danger: #E0705F;
    --aiw-danger-bg: #3A2624;
    --aiw-danger-border: #5C3733;

    box-shadow: 0 24px 60px rgba(0, 0, 0, .55);
}

body.oe-theme-dark .aiw-window .aiwProgressCard,
body.oe-theme-dark .aiw-window .aiwNextBox {
    background: linear-gradient(180deg, var(--aiw-teal-50), var(--aiw-white));
}

body.oe-theme-dark .aiw-window .aiwPrimary,
body.oe-theme-dark .aiw-window .aiwPrimary:hover,
body.oe-theme-dark .aiw-window .aiwEditKeys,
body.oe-theme-dark .aiw-window .aiwEdDone,
body.oe-theme-dark .aiw-window .aiwToolBtnOn,
body.oe-theme-dark .aiw-window .aiwToolBtnOn:hover {
    color: #FFFFFF;
}

body.oe-theme-dark .aiw-window .aiwMenu {
    box-shadow: 0 12px 28px rgba(0, 0, 0, .5);
}

body.oe-theme-dark.xadmintool .aiwLauncher,
body.oe-theme-dark .aiwLauncher {
    --aiwl-bg-top: #302626;
    --aiwl-bg-bottom: #2A2121;
    --aiwl-border: #46302E;
    --aiwl-accent: #B4534E;
    --aiwl-accent-hover: #C86A64;
    --aiwl-title: #EFC9C5;
    --aiwl-text: #BAC4CD;
    --aiwl-muted: #9AA7B3;
}
