/* AMÓS / TecSkill adapter. Load after the legacy template and theme sheets. */
@media screen {
/* Builder keeps its own variable API. Map that API to the corporate palette. */
html.tecskill-ui {
  --font-family: var(--font-sans);
  --font-size: 14px;
  --text-color: var(--ink);
  --text-color-strong: var(--ink-title);
  --text-color-light: var(--ink-muted);
  --template-border-color: var(--surface-border);
  --main-color: var(--accent);
  --live-background-color: var(--page);
  --content-background: var(--surface);
  --content-border-color: var(--surface-border);
  --content-border-radius: var(--radius-md);
  --panel-background: var(--surface);
  --panel-header-background: var(--surface);
  --panel-footer-background: var(--surface);
  --panel-header-color: var(--ink-title);
  --panel-border-color: var(--surface-border);
  --panel-border-radius: var(--radius-md);
  --panel-box-shadow: var(--shadow-shell);
  --panel-header-font-weight: 600;
  --header-background-color: var(--glass-float);
  --header-logo-background: var(--glass-float);
  --header-border-bottom: var(--glass-line);
  --header-logo-border-right: var(--glass-line);
  --header-logo-border-bottom: var(--glass-line);
  --header-track-border-right: var(--glass-line);
  --header-text-color: var(--ink-title);
  --header-logo-text-color: var(--ink-title);
  --header-box-shadow: var(--shadow-header);
  --menu-background-color: var(--sidebar-top);
  --submenu-background-color: var(--sidebar-mid);
  --menu-user-splash-background: var(--sidebar-mid);
  --menu-border-right: var(--sidebar-hairline);
  --submenu-border-right: var(--sidebar-hairline);
  --menu-master-color-strong: var(--sidebar-ink-active);
  --menu-check-color: var(--sidebar-ink-active);
  --menu-background-check: var(--sidebar-indicator);
  --submenu-sub-text-color: var(--sidebar-ink);
  --submenu-text-color: var(--sidebar-ink);
  --submenu-text-hover: var(--sidebar-ink-active);
  --submenu-check-color: var(--sidebar-ink-active);
  --submenu-background-check: var(--sidebar-indicator);
  --menu-background-button-circle: var(--sidebar-indicator);
  --menu-color-button-circle: var(--sidebar-ink-active);
  --top-menu-background-color: var(--glass-float);
  --top-menu-background-check: var(--accent-tint);
  --top-menu-check-color: var(--accent);
  --top-menu-hover-color: var(--accent);
  --top-menu-color: var(--ink);
  --top-submenu-background-color: var(--surface);
  --top-submenu-text-color: var(--ink-muted);
  --top-submenu-text-hover: var(--accent);
  --top-submenu-background-check: var(--accent-tint);
  --top-submenu-check-color: var(--accent);
  --top-menu-background-button-circle: var(--surface);
  --top-menu-color-button-circle: var(--ink-title);
  --button-text-color: var(--ink-title);
  --button-text-color-hover: var(--accent);
  --button-background: var(--surface);
  --button-border: var(--surface-border);
  --button-border-radius: var(--radius-field);
  --button-box-shadow: none;
  --field-height: 38px;
  --field-border-radius: var(--radius-field);
  --field-border-color: var(--field-border);
  --field-focus-border-color: var(--accent);
  --field-background: var(--field-bg);
  --field-color: var(--ink-title);
  --field-placeholder-color: var(--ink-muted);
  --field-check-color: var(--accent);
  --field-disabled-background: var(--neutral-bg);
  --field-disabled-text-color: var(--neutral-ink);
  --field-disabled-border: var(--surface-border);
  --table-body-color: var(--ink);
  --table-header-color: var(--ink-muted);
  --table-header-background: var(--surface);
  --table-header-border-color: var(--surface-border);
  --tr-hover-background: var(--accent-tint);
  --tr-hover-color: var(--ink-title);
  --tr-even-background: var(--surface);
  --tr-odd-background: var(--page);
  --tab-active-border-color: var(--accent);
  --tab-active-background: var(--surface);
  --tab-active-color: var(--accent);
  --tab-border-color: var(--surface-border);
  --tab-background: transparent;
  --tab-color: var(--ink-muted);
  --tab-border-radius: var(--radius-sm);
  --modal-background: var(--surface);
  --modal-header-background: var(--surface);
  --modal-header-color: var(--ink-title);
  --modal-footer-background: var(--page);
  --scrollbar-color: var(--surface-border);
  --preloader-color: var(--accent);
  --login-background-color: var(--page);
  --login-panel-header-background: var(--surface);
  --login-panel-left-background-color: var(--brand-navy);
  --login-panel-right-background-color: var(--surface);
  --login-panel-left-text-header-color: var(--on-primary);
  --login-panel-left-text-footer-color: var(--on-primary);
  --login-text-center-color: var(--accent);
  --login-title-color: var(--ink-title);
  --login-header-color: var(--ink-muted);
  --login-link-color: var(--accent);
  --login-button-background: var(--primary);
  --login-button-text-color: var(--on-primary);
  --login-border-color: var(--surface-border);
}

/* The Builder theme chooser changes a separate style link. Root classes and
   data-theme are managed by the shell, so this adapter follows those tokens. */
html.tecskill-ui[data-theme="dark"] { color-scheme: dark; }
html.tecskill-ui[data-theme="light"] { color-scheme: light; }

/* Shell: no body padding or height changes. Existing internal scroll area remains. */
html.tecskill-ui body.builder-template-layout { background: var(--page); color: var(--ink); font-family: var(--font-sans); }
html.tecskill-ui body.builder-template-layout .container-live { background: var(--page); color: var(--ink); }

/* TecSkill header shared by the desktop Builder and the native mobile shell.
   Keep the legacy header height and offsets for the sidebar and content. */
html.tecskill-ui #builder-layout > .container-header,
html.tecskill-ui #builder-layout.builder-template-layout > .nav.navbar {
  border: 1px solid var(--glass-line);
  border-radius: var(--radius-xl);
  background: var(--glass-float);
  color: var(--ink-title);
  box-shadow: var(--shadow-header);
  -webkit-backdrop-filter: blur(var(--glass-blur-float)) saturate(var(--glass-saturate));
  backdrop-filter: blur(var(--glass-blur-float)) saturate(var(--glass-saturate));
}
html.tecskill-ui #builder-layout > .container-header {
  width: auto;
  margin-inline: var(--space-2);
}
html.tecskill-ui .container-header :is(.header-logo, .header-track, .company-logo, .header-action),
html.tecskill-ui .container-header #top-menu {
  border-color: transparent;
  background: transparent;
}
html.tecskill-ui .container-header .header-action {
  gap: var(--space-1);
  padding-inline: var(--space-2);
}
html.tecskill-ui .container-header .navbar-custom-menu:empty { display: none; }
html.tecskill-ui .container-header .navbar-custom-menu .select2-selection {
  min-height: 36px;
  border-radius: var(--radius-field);
  background: var(--surface);
}
html.tecskill-ui .container-header .navbar-custom-menu .select2-selection--single {
  display: flex;
  align-items: center;
}
html.tecskill-ui .container-header .navbar-custom-menu .select2-selection__arrow {
  top: 50%;
  transform: translateY(-50%);
}
html.tecskill-ui .container-header .company-logo .logo-name { color: transparent; }
html.tecskill-ui .container-header :is(.fast-drop-label > .button-circle, #chat-start-icon) {
  display: inline-grid;
  place-items: center;
  margin-inline: 0;
  border: 1px solid var(--glass-line);
  border-radius: var(--radius-sm);
  background: var(--glass-card);
  color: var(--ink-title);
}
html.tecskill-ui .container-header :is(.fast-drop-label > .button-circle, #chat-start-icon):hover,
html.tecskill-ui .container-header .fast-drop:is(:hover, .tecskill-open) .fast-drop-label > .button-circle {
  border-color: var(--accent);
  background: var(--accent-tint);
  color: var(--ink-title);
}
html.tecskill-ui .container-header .ball-notice {
  background: var(--loss);
  color: var(--surface);
  font-weight: 700;
}
html.tecskill-ui .container-header .builder-profile-menu { width: auto; }
html.tecskill-ui .container-header .builder-profile-menu .fast-drop-label {
  height: auto;
  margin-block: auto;
  padding: var(--space-1) var(--space-2) var(--space-1) var(--space-1);
  border: 1px solid var(--glass-line);
  border-radius: var(--radius-pill);
  background: var(--glass-card);
}
html.tecskill-ui .container-header .builder-profile-menu .fast-drop {
  display: flex;
  align-items: center;
}
html.tecskill-ui .container-header .header-profile-photo {
  width: 32px;
  height: 32px;
  border: 1px solid var(--surface-border);
}
html.tecskill-ui .container-header .header-profile-name {
  width: auto;
  max-width: 10rem;
  font-weight: 650;
}
html.tecskill-ui .container-header .header-profile-name i { margin-inline-start: var(--space-1); }
html.tecskill-ui .container-header .fast-drop > .fast-drop-open {
  max-width: calc(100vw - 3rem);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-header);
}
html.tecskill-ui .container-header .builder-profile-menu .fast-drop > .fast-drop-open {
  top: 100%;
  bottom: auto;
  min-width: 12rem;
}
html.tecskill-ui .container-header .fast-drop-open a {
  margin: 0;
  padding: 6px var(--space-2);
  border-radius: var(--radius-field);
  white-space: normal;
}
html.tecskill-ui .container-header .fast-drop-open a:is(:hover, :focus-visible, .checked) {
  background: var(--accent-tint);
  color: var(--ink-title);
}
html.tecskill-ui .container-header .fast-drop > .fast-drop-open::after { content: none; }

/* The optional horizontal navigation uses the same surface and active state. */
html.tecskill-ui .container-header #navbar-builder-top-menu-collapse {
  --top-menu-background-color: transparent;
  --top-menu-border: var(--glass-line);
  --top-menu-check-color: var(--ink-title);
}
html.tecskill-ui .container-header #top-menu .button-circle-label {
  border-color: transparent;
  border-radius: var(--radius-sm);
  font-weight: 550;
}
html.tecskill-ui .container-header #top-menu .button-circle-label:is(:hover, .checked) {
  background: var(--accent-tint);
  color: var(--ink-title);
}
html.tecskill-ui #builder-layout #navbar-builder-top-submenu-collapse {
  --top-submenu-background-color: var(--surface);
  --top-submenu-check-color: var(--ink-title);
  --top-submenu-text-hover: var(--ink-title);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-shell);
}
html.tecskill-ui #builder-layout #top-submenu.container-submenu a {
  border-radius: var(--radius-field);
}
html.tecskill-ui #builder-layout #top-submenu.container-submenu a:hover {
  background: var(--accent-tint);
}

@media (width > 992px) {
  html.tecskill-ui .container-header .navbar-custom-menu {
    margin-inline-end: auto;
    padding-inline: var(--space-4);
  }
}
@media (max-width: 992px) {
  html.tecskill-ui #builder-layout:not(.layout-mobile) .container-header .header-logo { width: 100%; }
  html.tecskill-ui #builder-layout:not(.layout-mobile) .container-header .header-track {
    position: absolute;
    inset-inline: 0;
    justify-content: flex-start;
    width: auto;
    max-height: calc(100vh - var(--header-height) - var(--space-2));
    max-height: calc(100dvh - var(--header-height) - var(--space-2));
    border: 1px solid var(--glass-line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-header);
  }
  html.tecskill-ui #builder-layout .header-track #navbar-builder-top-submenu-collapse {
    flex: 0 0 auto !important;
  }
  html.tecskill-ui #builder-layout .header-track #navbar-builder-top-menu-collapse #top-menu {
    width: 100%;
    height: auto;
    max-height: min(30vh, 12rem);
    overflow: auto;
  }
  html.tecskill-ui .container-header .toggle-menu,
  html.tecskill-ui .container-header .toggle-top-menu {
    position: absolute;
    border-radius: var(--radius-md);
  }
}
/* Keep Builder's rail and submenu as one continuous TecSkill surface. */
html.tecskill-ui body.builder-template-layout .master-menu-content,
html.tecskill-ui body.layout-mobile .sidebar,
html.tecskill-ui body.theme-red .sidebar {
  --text-color-light: var(--sidebar-ink);
  background: var(--sidebar-background);
  border-start-end-radius: var(--radius-md);
  border-end-end-radius: var(--radius-md);
  color: var(--sidebar-ink);
}
@media (min-width: 992px) {
  html.tecskill-ui body.builder-template-layout .master-menu-content {
    margin-block: var(--space-2);
    margin-inline-start: var(--space-2);
    border-radius: var(--radius-xl);
    box-shadow: inset 0 0 0 1px var(--sidebar-hairline), var(--shadow-shell);
  }
}
html.tecskill-ui body.builder-template-layout .master-menu-content .container-menu,
html.tecskill-ui body.builder-template-layout .master-menu-content .container-submenu { background: transparent; }
html.tecskill-ui body.builder-template-layout .master-menu-content .container-submenu { border-right: 0; }
html.tecskill-ui body.builder-template-layout .master-menu-content a { color: var(--sidebar-ink); }
html.tecskill-ui body.builder-template-layout .master-menu-content a:hover,
html.tecskill-ui body.builder-template-layout .master-menu-content .checked > a { color: var(--sidebar-ink-active); }
html.tecskill-ui body.builder-template-layout .master-menu-content .checked > a { background: var(--sidebar-indicator); box-shadow: inset 0 0 0 1px var(--sidebar-indicator-line); }
/* Module tones: menu.xml gives each module icon a color; the renderer exposes it
   as --module-tone. The sidebar is dark in both themes, so the tones are the light
   400/300 steps and the solid active chip uses dark ink. */
html.tecskill-ui body.builder-template-layout .master-menu-content .button-circle[style*="--module-tone"] { background: color-mix(in srgb, var(--module-tone) 15%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--module-tone) 32%, transparent); transition: background-color .16s ease, box-shadow .16s ease, transform .16s ease; }
html.tecskill-ui body.builder-template-layout .master-menu-content .button-circle[style*="--module-tone"] i { color: var(--module-tone) !important; transition: color .16s ease; }
html.tecskill-ui body.builder-template-layout .master-menu-content .button-circle[style*="--module-tone"]:hover { background: color-mix(in srgb, var(--module-tone) 28%, transparent); transform: translateY(-1px); }
html.tecskill-ui body.builder-template-layout .master-menu-content .button-circle.checked[style*="--module-tone"] { background: var(--module-tone); box-shadow: 0 0 0 3px color-mix(in srgb, var(--module-tone) 28%, transparent), 0 8px 18px -8px var(--module-tone); }
html.tecskill-ui body.builder-template-layout .master-menu-content .button-circle.checked[style*="--module-tone"] i { color: var(--sidebar-bottom) !important; }
html.tecskill-ui body.builder-template-layout .master-menu-content [module-menu][style*="--module-tone"] a > i { color: var(--module-tone); opacity: .92; }
html.tecskill-ui body.builder-template-layout .master-menu-content [module-menu][style*="--module-tone"] a:hover > i,
html.tecskill-ui body.builder-template-layout .master-menu-content [module-menu][style*="--module-tone"] .checked > a > i { opacity: 1; }
html.tecskill-ui body.builder-template-layout .master-menu-content .container-submenu > ul {
  padding-block: var(--space-2);
}
html.tecskill-ui body.builder-template-layout .master-menu-content .container-submenu > ul > li {
  padding-inline: var(--sidebar-inset);
}
html.tecskill-ui body.builder-template-layout .master-menu-content .container-submenu li > a,
html.tecskill-ui :is(body.layout-mobile, body.theme-red) .sidebar .menu .list li > a {
  min-height: 2.2rem;
  margin-block: 2px;
  border-radius: var(--radius-md);
  font-weight: 500;
  line-height: 1.3;
}
html.tecskill-ui body.builder-template-layout .master-menu-content .container-submenu li > a:hover,
html.tecskill-ui body.builder-template-layout .master-menu-content .container-submenu li > a.sub.open,
html.tecskill-ui :is(body.layout-mobile, body.theme-red) .sidebar .menu .list li > a:is(:hover, .toggled) {
  background: var(--sidebar-indicator);
  color: var(--sidebar-ink-active);
}
html.tecskill-ui body.builder-template-layout .master-menu-content .container-submenu li.checked > a,
html.tecskill-ui :is(body.layout-mobile, body.theme-red) .sidebar .menu .list li.active > a {
  background: var(--sidebar-indicator);
  box-shadow: inset 3px 0 var(--accent), inset 0 0 0 1px var(--sidebar-indicator-line);
  color: var(--sidebar-ink-active);
  font-weight: 700;
}
html.tecskill-ui body.builder-template-layout .master-menu-content a:focus-visible,
html.tecskill-ui :is(body.layout-mobile, body.theme-red) .sidebar a:focus-visible {
  outline-color: var(--sidebar-ink-active) !important;
  outline-offset: -2px;
}
@media (prefers-reduced-motion: reduce) {
  html.tecskill-ui body.builder-template-layout .master-menu-content .button-circle[style*="--module-tone"],
  html.tecskill-ui body.builder-template-layout .master-menu-content .button-circle[style*="--module-tone"] i { transition: none; }
  html.tecskill-ui body.builder-template-layout .master-menu-content .button-circle[style*="--module-tone"]:hover { transform: none; }
}
/* Sidebar scrollbar: the theme default (3px, border color) vanishes on the dark sidebar. */
html.tecskill-ui body.builder-template-layout .master-menu-content .container-menu,
html.tecskill-ui body.builder-template-layout .master-menu-content .container-submenu { scrollbar-width: thin; scrollbar-color: rgba(231, 235, 246, 0.42) rgba(255, 255, 255, 0.05); }
html.tecskill-ui body.builder-template-layout .master-menu-content .container-menu::-webkit-scrollbar,
html.tecskill-ui body.builder-template-layout .master-menu-content .container-submenu::-webkit-scrollbar { width: 8px; }
html.tecskill-ui body.builder-template-layout .master-menu-content .container-menu::-webkit-scrollbar-track,
html.tecskill-ui body.builder-template-layout .master-menu-content .container-submenu::-webkit-scrollbar-track { background: rgba(255, 255, 255, 0.05); }
html.tecskill-ui body.builder-template-layout .master-menu-content .container-menu::-webkit-scrollbar-thumb,
html.tecskill-ui body.builder-template-layout .master-menu-content .container-submenu::-webkit-scrollbar-thumb { border: 2px solid transparent; border-radius: 99px; background: rgba(231, 235, 246, 0.42) padding-box; }
html.tecskill-ui body.builder-template-layout .master-menu-content .container-menu::-webkit-scrollbar-thumb:hover,
html.tecskill-ui body.builder-template-layout .master-menu-content .container-submenu::-webkit-scrollbar-thumb:hover { background-color: rgba(231, 235, 246, 0.68); }
html.tecskill-ui body.builder-template-layout .master-menu-content .splash-user-content {
  padding: var(--space-4) var(--sidebar-inset);
  border-bottom: 1px solid var(--sidebar-hairline);
  background: transparent;
}
html.tecskill-ui body.builder-template-layout .master-menu-content .splash-user-name { color: var(--sidebar-ink-active); }
html.tecskill-ui body.builder-template-layout .master-menu-content .splash-user-att { color: var(--sidebar-ink); }
html.tecskill-ui body.builder-template-layout .button-circle:focus-visible,
html.tecskill-ui body.builder-template-layout .toggle-menu:focus-visible,
html.tecskill-ui body.builder-template-layout .toggle-top-menu:focus-visible { outline: 2px solid var(--accent) !important; outline-offset: 2px; }

/* Adianti forms and Bootstrap widgets. Keep validation colors intact. */
html.tecskill-ui .panel,
html.tecskill-ui .card.panel { border-color: var(--surface-border); border-radius: var(--radius-md); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-shell); }
html.tecskill-ui .panel > .panel-heading,
html.tecskill-ui .card.panel > .panel-heading { border-color: var(--surface-border); background: var(--surface); color: var(--ink-title); }
html.tecskill-ui .panel > .panel-footer,
html.tecskill-ui .card.panel > .panel-footer { border-color: var(--surface-border); background: var(--page); }
html.tecskill-ui .panel-title,
html.tecskill-ui .card-title { color: var(--ink-title); font-weight: 650; }
html.tecskill-ui .form-control,
html.tecskill-ui .tfield,
html.tecskill-ui .tcombo,
html.tecskill-ui .tselect,
html.tecskill-ui textarea,
html.tecskill-ui select { border-color: var(--field-border); border-radius: var(--radius-field); background-color: var(--field-bg); color: var(--ink-title); font-family: var(--font-sans); }
html.tecskill-ui .form-control::placeholder,
html.tecskill-ui .tfield::placeholder,
html.tecskill-ui textarea::placeholder { color: var(--ink-muted); opacity: 1; }
html.tecskill-ui label,
html.tecskill-ui .control-label { color: var(--ink-muted); font-weight: 600; }
html.tecskill-ui .input-group-addon { border-color: var(--field-border); background: var(--page); color: var(--ink-muted); }
html.tecskill-ui .form-control:disabled,
html.tecskill-ui .form-control[readonly],
html.tecskill-ui .tfield_disabled,
html.tecskill-ui .tcombo_disabled { border-color: var(--surface-border); background: var(--neutral-bg); color: var(--neutral-ink); }
html.tecskill-ui .has-error .form-control,
html.tecskill-ui .is-invalid { border-color: var(--danger-ink); }
html.tecskill-ui .help-block,
html.tecskill-ui .form-text { color: var(--ink-muted); }
html.tecskill-ui .has-error .help-block,
html.tecskill-ui .invalid-feedback { color: var(--danger-ink); }

html.tecskill-ui .btn:not(.btn-success):not(.btn-info):not(.btn-warning):not(.btn-danger):not(.btn-link) { border-radius: var(--radius-field); }
html.tecskill-ui .btn-primary,
html.tecskill-ui a.btn-primary { border-color: var(--primary); background: var(--primary); color: var(--on-primary); }
html.tecskill-ui .btn-primary:hover,
html.tecskill-ui a.btn-primary:hover { border-color: var(--primary-dark); background: var(--primary-dark); color: var(--on-primary); }
html.tecskill-ui .btn-default,
html.tecskill-ui .btn-secondary { border-color: var(--surface-border); background: var(--surface); color: var(--ink-title); }
html.tecskill-ui .btn-default:hover,
html.tecskill-ui .btn-secondary:hover { border-color: var(--accent); color: var(--accent); }

/* Dense data grids scroll inside their allocated content, never via body. */
html.tecskill-ui .table-responsive,
html.tecskill-ui .dataTables_wrapper,
html.tecskill-ui .datagrid-wrapper { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
html.tecskill-ui form[name^="datagrid_form"] {
  display: block;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
}
html.tecskill-ui .table:not(.table-bordered),
html.tecskill-ui table.dataTable { background: var(--surface); color: var(--ink); }
html.tecskill-ui .table thead th,
html.tecskill-ui table.dataTable thead th { border-color: var(--surface-border); background: var(--surface); color: var(--ink-muted); font-weight: 700; }
html.tecskill-ui .table tbody td,
html.tecskill-ui table.dataTable tbody td { border-color: var(--surface-border); color: var(--ink); }
html.tecskill-ui .table-hover tbody tr:hover,
html.tecskill-ui table.dataTable tbody tr:hover { background: var(--accent-tint); }
html.tecskill-ui .pagination .page-link { border-color: var(--surface-border); background: var(--surface); color: var(--ink); }
html.tecskill-ui .pagination .active .page-link { border-color: var(--accent); background: var(--accent); color: var(--on-primary); }

/* Select2 popovers can be mounted outside the form and outside the live pane. */
html.tecskill-ui .select2-container--default .select2-selection--single,
html.tecskill-ui .select2-container--default .select2-selection--multiple,
html.tecskill-ui .select2-dropdown { border-color: var(--field-border); border-radius: var(--radius-field); background: var(--field-bg); color: var(--ink-title); }
html.tecskill-ui .select2-container--default .select2-selection--single .select2-selection__rendered,
html.tecskill-ui .select2-results__option { color: var(--ink-title); }
html.tecskill-ui .select2-container--default .select2-selection__placeholder { color: var(--ink-muted); }
html.tecskill-ui .select2-container--default .select2-results__option--highlighted[aria-selected] { background: var(--accent); color: var(--on-primary); }
html.tecskill-ui .select2-container--default .select2-results__option[aria-selected=true] { background: var(--accent-tint); color: var(--ink-title); }
html.tecskill-ui .select2-search__field { border-color: var(--field-border); background: var(--field-bg); color: var(--ink-title); }

/* Charts retain their series and business colors; only the chrome follows theme. */
html.tecskill-ui .chart-container { min-width: 0; max-width: 100%; }
html.tecskill-ui .c3 text { fill: var(--ink-muted); font-family: var(--font-sans); }
html.tecskill-ui .c3-axis path,
html.tecskill-ui .c3-axis line,
html.tecskill-ui .c3-grid line { stroke: var(--surface-border); }
html.tecskill-ui .c3-tooltip { border-color: var(--surface-border); background: var(--surface); color: var(--ink); }
html.tecskill-ui .c3 { background: transparent; }
html.tecskill-ui .c3-chart-arcs .c3-chart-arc path { opacity: 1 !important; stroke: var(--surface); stroke-width: 2px; }
html.tecskill-ui .c3-chart-arc text { fill: #fff; font-size: 12px; font-weight: 600; }
html.tecskill-ui .c3-legend-item text { fill: var(--ink); }
html.tecskill-ui .c3-tooltip th,
html.tecskill-ui .c3-tooltip td { border-color: var(--surface-border); background: var(--surface); color: var(--ink); }
html.tecskill-ui .bindicator-card { border-radius: var(--radius-md); box-shadow: var(--shadow-shell); }
html.tecskill-ui .bindicator-card-value { font-variant-numeric: tabular-nums; }

html.tecskill-ui .alert-success { background: var(--ok-bg); color: var(--ok-ink); border-color: var(--ok-ink); }
html.tecskill-ui .alert-danger { background: var(--danger-bg); color: var(--danger-ink); border-color: var(--danger-ink); }
html.tecskill-ui .alert-warning { background: var(--warn-bg); color: var(--warn-ink); border-color: var(--warn-ink); }
html.tecskill-ui .alert-info { background: var(--info-bg); color: var(--info-ink); border-color: var(--info-ink); }
html.tecskill-ui .datepicker,
html.tecskill-ui .datetimepicker,
html.tecskill-ui .ui-datepicker { border-color: var(--surface-border); background: var(--surface); color: var(--ink); }
html.tecskill-ui .datepicker table tr td:hover,
html.tecskill-ui .datepicker table tr td.day:hover { background: var(--accent-tint); color: var(--accent); }
html.tecskill-ui .datepicker table tr td.active { background: var(--accent); color: var(--on-primary); }
html.tecskill-ui .fc { color: var(--ink); }
html.tecskill-ui .fc-theme-standard td,
html.tecskill-ui .fc-theme-standard th { border-color: var(--surface-border); }
html.tecskill-ui .fc-theme-standard .fc-scrollgrid { border-color: var(--surface-border); }
html.tecskill-ui .fc .fc-daygrid-day.fc-day-today { background: var(--accent-tint); }

/* Password eye shares the field border and remains reachable by touch. */
html.tecskill-ui .tpassword {
  display: flex;
  align-items: stretch;
  min-width: 0;
  border: 1px solid var(--field-border);
  border-radius: var(--radius-field);
  background: var(--field-bg);
}
html.tecskill-ui .tpassword input {
  flex: 1 1 auto;
  min-width: 0;
  width: calc(100% - 44px) !important;
  border: 0 !important;
  background: transparent;
}
html.tecskill-ui .tpassword button {
  position: static;
  flex: 0 0 44px;
  width: 44px;
  height: auto;
  min-height: 44px;
  border: 0;
  background: transparent;
  color: var(--ink-muted);
}

/* Tabs, dialog and overlays. Preserve the legacy stacking mechanism. */
html.tecskill-ui .nav-tabs { border-color: var(--surface-border); }
html.tecskill-ui .nav-tabs .nav-link,
html.tecskill-ui .tnotebook .nav.nav-tabs .nav-item .nav-link { border-radius: var(--radius-sm) var(--radius-sm) 0 0; color: var(--ink-muted); }
html.tecskill-ui .nav-tabs .nav-link.active,
html.tecskill-ui .tnotebook .nav.nav-tabs .nav-item .nav-link.active { border-color: var(--surface-border) var(--surface-border) var(--accent); background: var(--surface); color: var(--accent); }
html.tecskill-ui .tab-content { color: var(--ink); }
html.tecskill-ui .ui-dialog,
html.tecskill-ui .modal-content { border-color: var(--surface-border); border-radius: var(--radius-lg); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-header); }
html.tecskill-ui .ui-dialog .ui-dialog-titlebar,
html.tecskill-ui .modal-header { border-color: var(--surface-border); background: var(--surface); color: var(--ink-title); }
html.tecskill-ui .ui-dialog .ui-dialog-buttonpane,
html.tecskill-ui .modal-footer { border-color: var(--surface-border); background: var(--page); }
html.tecskill-ui .dropdown-menu,
html.tecskill-ui .popover { border-color: var(--surface-border); border-radius: var(--radius-md); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-shell); }
html.tecskill-ui .dropdown-item,
html.tecskill-ui .popover-body { color: var(--ink); }
html.tecskill-ui .dropdown-item:hover { background: var(--accent-tint); color: var(--accent); }

/* Kanban stage colors are business data and remain untouched. */
html.tecskill-ui .kanban-stage { border-color: var(--surface-border); border-radius: var(--radius-md); }
html.tecskill-ui .kanban-item,
html.tecskill-ui .card.panel.card-item { border-color: var(--surface-border); border-radius: var(--radius-md); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-shell); }
html.tecskill-ui .kanban-item-title { color: var(--ink-title); font-weight: 700; }
html.tecskill-ui .kanban-item:hover,
html.tecskill-ui .card.panel.card-item:hover { box-shadow: var(--shadow-hover); }
html.tecskill-ui .kanban-item-actions a,
html.tecskill-ui .card-item-actions a { border-radius: var(--radius-field); }
html.tecskill-ui .small-box,
html.tecskill-ui .info-box,
html.tecskill-ui .dashboard-stat-list { border-radius: var(--radius-md); }
html.tecskill-ui .small-box .inner h3,
html.tecskill-ui .info-box-number { font-variant-numeric: tabular-nums; }

/* Compact login. Keep the AMÓS logo used by the form and remove only the old
   background/detail imagery, which conflicts with both TecSkill themes. */
html.tecskill-ui body.builder-template-login .container-login {
  min-height: 100vh;
  height: auto;
  padding: 1.5rem;
  background: radial-gradient(48% 38% at 8% 4%, rgba(var(--accent-rgb), .1), transparent 75%),
              radial-gradient(45% 40% at 98% 96%, rgba(8, 120, 255, .07), transparent 76%),
              var(--page);
  color: var(--ink);
  font-family: var(--font-sans);
}
html.tecskill-ui body.builder-template-login .container-login .panel-login {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  width: min(100%, 480px);
  max-width: 480px;
  max-height: none;
  height: auto;
  margin: auto;
  border: 1px solid var(--glass-line);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow-header);
}
html.tecskill-ui body.builder-template-login .container-login .panel-login .info-login { display: none; }
html.tecskill-ui body.builder-template-login .container-login .panel-login .login-content {
  box-sizing: border-box;
  width: 100%;
  padding: clamp(1.25rem, 4vw, 2rem);
  background: var(--surface);
  color: var(--ink-title);
}
html.tecskill-ui body.builder-template-login .container-login .login-content [page-name="LoginForm"] .card.panel,
html.tecskill-ui body.builder-template-login .container-login .login-content [page-name="LoginForm"] .card { border: 0; border-radius: var(--radius-md); background: transparent; box-shadow: none; }
html.tecskill-ui body.builder-template-login .container-login .login-content h1 { font-size: 28px; line-height: 1.2; letter-spacing: -.025em; }
html.tecskill-ui body.builder-template-login .container-login .login-content [page-name="LoginForm"] .tfield,
html.tecskill-ui body.builder-template-login .container-login .login-content [page-name="LoginForm"] .tcombo,
html.tecskill-ui body.builder-template-login .container-login .login-content [page-name="LoginForm"] .btn { min-height: 44px; }
html.tecskill-ui body.builder-template-login .container-login .login-content [page-name="LoginForm"] .tfield { height: 44px !important; }
html.tecskill-ui body.builder-template-login .container-login .login-content [page-name="LoginForm"] .btn { border-color: var(--primary); border-radius: var(--radius-field); background: var(--primary); color: var(--on-primary); }
html.tecskill-ui body.builder-template-login .container-login .login-content [page-name="LoginForm"] .btn:hover { background: var(--primary-dark); opacity: 1; }
html.tecskill-ui body.builder-template-login .container-login .login-content a { color: var(--accent); }
html.tecskill-ui body.builder-template-login .login-medium-logo {
  width: 120px;
  height: 120px;
  min-height: 120px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background-color: white;
  background-image: url('../../app/images/builderLogoLogin.jpeg');
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
}

/* The fallback toggle is inserted by adianti-theme.js into the header,
   mobile navbar, login content or iframe body. */
html.tecskill-ui .tecskill-theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  box-sizing: border-box;
  min-width: 44px;
  min-height: 44px;
  padding: .45rem .8rem;
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  box-shadow: var(--shadow-shell);
  color: var(--ink-title);
  font: 600 .85rem/1.2 var(--font-sans);
  white-space: nowrap;
  cursor: pointer;
}
html.tecskill-ui .tecskill-theme-toggle:hover { border-color: var(--accent); color: var(--accent); }
html.tecskill-ui .tecskill-theme-toggle:focus-visible { outline: 2px solid var(--accent) !important; outline-offset: 2px; }
html.tecskill-ui .container-header .tecskill-theme-toggle { align-self: center; flex: 0 0 auto; margin: 0 .6rem; }
html.tecskill-ui .container-login .login-content .tecskill-theme-toggle { align-self: flex-end; margin-bottom: .5rem; }
html.tecskill-ui#iframe_content body > .tecskill-theme-toggle { position: fixed; z-index: 60; top: .4rem; right: .6rem; }

/* Existing template declares outline:none !important. Restore visible keyboard focus. */
html.tecskill-ui :is(a, button, input, select, textarea, [role="button"], [tabindex]):focus-visible,
html.tecskill-ui .select2-container--focus .select2-selection,
html.tecskill-ui .select2-container--open .select2-selection { outline: 2px solid var(--accent) !important; outline-offset: 2px; }

/* theme4 is the independently selected mobile template. */
html.tecskill-ui #builder-layout.builder-template-layout > .nav.navbar {
  inset-inline: var(--space-2);
  width: auto;
}
html.tecskill-ui #builder-layout > .nav.navbar :is(.navbar-toggler, .bars, .navbar-nav > li > a) {
  color: var(--ink-title);
}
html.tecskill-ui #builder-layout > .nav.navbar .navbar-nav > li > a:is(:hover, :focus-visible) {
  background: var(--accent-tint);
  color: var(--ink-title);
}
html.tecskill-ui #builder-layout > .nav.navbar .navbar-nav .dropdown-menu {
  max-width: calc(100vw - 2rem);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-header);
}
html.tecskill-ui #builder-layout.layout-mobile > .nav.navbar {
  flex-wrap: nowrap;
  align-items: center;
  gap: var(--space-1);
  padding-inline: var(--space-1);
}
html.tecskill-ui #builder-layout.layout-mobile > .nav.navbar .navbar-brand {
  flex: 1 1 100px;
  min-width: 0;
  height: 32px;
  padding: 0 !important;
  border-radius: var(--radius-sm);
}
html.tecskill-ui #builder-layout.layout-mobile > .nav.navbar .tecskill-theme-toggle {
  padding-inline: var(--space-2);
}
html.tecskill-ui #builder-layout.layout-mobile > .nav.navbar .notifications .navbar-nav {
  align-items: center;
  gap: var(--space-1);
}
html.tecskill-ui #builder-layout.layout-mobile > .nav.navbar .navbar-nav > li > a {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--glass-line);
  border-radius: var(--radius-sm);
  background: var(--glass-card);
}
html.tecskill-ui #builder-layout.layout-mobile > .nav.navbar .navbar-nav > li > a i { font-size: 20px !important; }
html.tecskill-ui #builder-layout.layout-mobile > .nav.navbar .label-count {
  top: 2px;
  right: 2px;
  border-radius: var(--radius-pill);
  background: var(--loss);
  color: var(--surface);
}
html.tecskill-ui :is(body.layout-mobile, body.theme-red) .sidebar .menu .list a {
  align-items: center;
  width: calc(100% - 2 * var(--sidebar-inset));
  margin-inline: var(--sidebar-inset);
  color: var(--sidebar-ink);
}
html.tecskill-ui :is(body.layout-mobile, body.theme-red) .sidebar .menu .list a > :is(i, span) { color: inherit; }
html.tecskill-ui :is(body.layout-mobile, body.theme-red) .sidebar .menu .list a > span { font-weight: inherit; }
html.tecskill-ui :is(body.layout-mobile, body.theme-red) .sidebar .user-info {
  border-bottom-color: var(--sidebar-hairline);
  background: transparent;
}
html.tecskill-ui :is(body.layout-mobile, body.theme-red) .sidebar .legal {
  border-top-color: var(--sidebar-hairline);
  border-end-end-radius: inherit;
  background: var(--sidebar-bottom);
  color: var(--sidebar-ink);
}
html.tecskill-ui body.layout-mobile .content,
html.tecskill-ui body.theme-red .content { background: var(--page); color: var(--ink); }
html.tecskill-ui body.layout-mobile .card.panel:not([class*="bg-"]),
html.tecskill-ui body.theme-red .card.panel:not([class*="bg-"]) { border-radius: var(--radius-md); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-shell); }
html.tecskill-ui body.builder-template-login.layout-mobile { min-height: 100vh; background: var(--page); color: var(--ink); }
html.tecskill-ui body.builder-template-login.layout-mobile #wrapper { box-sizing: border-box; width: min(90%, 480px) !important; }
html.tecskill-ui body.builder-template-login.layout-mobile #wrapper .card.panel:not([class*="bg-"]) { border: 1px solid var(--surface-border); border-radius: var(--radius-xl); background: var(--surface); box-shadow: var(--shadow-header); }
html.tecskill-ui body.builder-template-login.layout-mobile #wrapper .login-medium-logo { min-height: 96px; background-image: url('../../app/images/builderLogoLogin.jpeg'); background-size: contain; background-position: center; background-repeat: no-repeat; }

/* Iframes ship body background:white inline. Scope the exception to that page. */
html.tecskill-ui#iframe_content body { background: var(--page) !important; color: var(--ink); }
html.tecskill-ui#iframe_content #adianti_div_content { background: var(--page) !important; color: var(--ink); }

@media (max-width: 767px), (pointer: coarse) {
  html.tecskill-ui body.builder-template-login .container-login .panel-login {
    height: auto !important;
    max-height: none !important;
    max-width: 480px !important;
    border-radius: var(--radius-xl) !important;
    overflow: hidden;
  }
  html.tecskill-ui body.builder-template-login .container-login .panel-login .login-content {
    border-radius: var(--radius-xl) !important;
  }
  html.tecskill-ui :is(.btn, .button-circle, .pagination .page-link, .nav-tabs .nav-link, .kanban-item-actions a, .card-item-actions a) { min-height: 44px; min-width: 44px; }
  html.tecskill-ui .form-control,
  html.tecskill-ui .tfield,
  html.tecskill-ui .tcombo,
  html.tecskill-ui .select2-container--default .select2-selection--single { min-height: 44px; }
  html.tecskill-ui .container-live { padding: 12px; }
  html.tecskill-ui .table-responsive,
  html.tecskill-ui .dataTables_wrapper { max-width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  html.tecskill-ui .kanban-item,
  html.tecskill-ui .card.panel.card-item { transition: none; }
}
}

@media print {
  html.tecskill-ui { color-scheme: light !important; }
  .tecskill-theme-toggle { display: none !important; }
}
