/* Final presentation layer. Stable geometry, subtle states and shared identity. */
:root { --ui-radius: 16px; --ui-ease: cubic-bezier(.2,.7,.2,1); }
.kx-svg-icon { display: inline-block; width: 18px; height: 18px; flex-shrink: 0; vertical-align: -.18em; color: inherit; }
.mg-audit-icon > svg, .mg-section-icon > svg, .mg-ticket-option-icon > svg, .mg-ticket-option-mark > svg, .mg-ticket-symbol > svg, .mg-symbol-option > svg, .mg-dialog-close > svg, .kx-modal-close > svg { display: block; margin: 0; vertical-align: middle; flex-shrink: 0; }
.kx-svg-icon path, .kx-svg-icon circle, .kx-svg-icon rect { vector-effect: non-scaling-stroke; }
html body [data-site-main] :is(h1,h2,h3,p,dd,button,a) { overflow-wrap: anywhere; }
html body [data-site-main] :is(h1,h2,h3) { text-wrap: balance; }
/* Support is available in the shared navbar/footer; the old duplicate covered workspace actions. */
html body[data-site-page="dashboard"] #storm-discord-fab,
html body[data-site-page="aplicacoes"] #storm-discord-fab { display: none !important; }
html body [data-site-main] :is(.grid,.flex,section,article,form,header) { min-width: 0; }
html body [data-site-main] :is(input,select,textarea) { min-width: 0; max-width: 100%; }
html body [data-site-main] input[type="number"] { font-variant-numeric: tabular-nums; }
html body [data-site-main] :is(button,a[role="button"],.mg-button,.cp-button,.kx-admin-button,.plans-purchase) { min-height: 44px; touch-action: manipulation; }
html body [data-site-main] button:disabled { cursor: not-allowed; transform: none !important; }
html body [data-site-main] :is(button,a,input,textarea,select):focus-visible { outline: 2px solid var(--site-focus) !important; outline-offset: 3px; }
html body [data-site-main] :is(.storm-panel,.storm-card,.mg-section,.mg-card,.cp-card,.kx-admin-card) { border-color: var(--site-border) !important; }
html body [data-site-main] :is(.storm-card,.mg-card,.cp-card,.kx-admin-card) { transition: border-color .2s var(--ui-ease), background-color .2s var(--ui-ease), box-shadow .2s var(--ui-ease); }
@media (hover:hover) and (pointer:fine) {
  html body [data-site-main] :is(.storm-card,.mg-card,.cp-card,.kx-admin-card):hover { border-color: var(--site-border-strong) !important; }
  html body [data-site-main] :is(button,a[role="button"],.mg-button,.cp-button,.kx-admin-button):hover { filter: none !important; box-shadow: none; }
}
/* Labels stay within the width of their control; all controls have touch space. */
html body .kx-label-input { --kx-field-height: 48px; margin-top: 12px; min-width: 0; }
html body .kx-label-input > .kx-floating-label { z-index: 3; max-width: calc(100% - 28px) !important; pointer-events: none; }
html body .kx-label-input:is(:focus-within,.is-always-floated,.is-filled) > .kx-floating-label,
html body .kx-label-input .kx-label-control:not(:placeholder-shown) ~ .kx-floating-label { font-size: 11px !important; line-height: 16px !important; max-width: calc(100% - 28px) !important; transform: translateY(-50%) !important; }
html body .kx-label-input.has-prefix:is(:focus-within,.is-always-floated,.is-filled) > .kx-floating-label { left: 13px !important; max-width: calc(100% - 28px) !important; }
html body .kx-label-input.has-password > .kx-floating-label { max-width: calc(100% - 64px) !important; }
html body .kx-label-input > .kx-label-control:focus { outline: none !important; box-shadow: 0 0 0 2px var(--kx-field-ring) !important; }
html body .kx-label-input > .kx-password-toggle { width: 44px !important; min-width: 44px; height: 46px !important; }
html body .kx-label-input.is-custom-select > .custom-select-dropdown { position: static !important; }
html body .kx-label-input.is-custom-select { overflow: visible !important; }
html body .kx-label-input.is-custom-select > .custom-select-dropdown > .select-trigger { position: relative !important; z-index: 1; min-height: 48px !important; }
/* Lists expand in the document flow, so neither labels nor following fields overlap. */
html body[data-site-page="gerenciar"] .custom-select-dropdown .select-menu,
html body .custom-select-dropdown .select-menu {
  position: relative !important; inset: auto !important; display: block; width: 100% !important; max-width: 100% !important;
  min-width: 0; max-height: none !important; margin: 12px 0 0 !important; padding: 12px !important;
  border: 1px solid var(--site-border-strong) !important; border-radius: 13px; background: var(--site-surface) !important;
  box-shadow: 0 4px 16px color-mix(in srgb,var(--site-overlay) 15%,transparent) !important; backdrop-filter: none !important;
  overflow: visible !important; transform: none !important; translate: none !important; z-index: auto !important;
}
html body .custom-select-dropdown .select-menu.hidden { display: none !important; }
html body .custom-select-dropdown { z-index: auto !important; }
.mg-select-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-bottom: 5px; color: var(--site-muted); font-size: 11px; }
.mg-ticket-symbol { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--site-raised); border: 1px solid var(--site-border); flex-shrink: 0; }
.mg-symbol-dialog { width: min(100%,480px); padding: 26px; border: 1px solid var(--site-border-strong); border-radius: 20px; background: var(--site-surface); }
.mg-symbol-dialog h2 { margin: 0 0 9px; font-size: 23px; font-weight: 600; letter-spacing: -.035em; }
.mg-symbol-dialog p { font-size: 13px; line-height: 1.7; color: var(--site-muted); margin: 0; }
.mg-symbol-options { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; margin: 24px 0 18px; }
.mg-symbol-option { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 20px 8px; border: 1px solid var(--site-border); border-radius: 12px; background: var(--site-bg); color: var(--site-text); font: inherit; font-size: 11px; cursor: pointer; }
.mg-symbol-option:hover { background: var(--site-raised); border-color: var(--site-border-strong); }
.mg-symbol-option .kx-svg-icon { width: 24px; height: 24px; }
.mg-select-heading > span { min-width: 0; overflow-wrap: anywhere; }
.mg-select-done { display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-height: 44px; padding: 8px 10px; border: 1px solid var(--site-border); border-radius: 8px; background: var(--site-raised); color: var(--site-text); font: inherit; font-size: 11px; flex-shrink: 0; cursor: pointer; }
html body .select-menu .options-list { max-height: min(260px,42dvh); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; padding: 2px; margin-top: 12px; }
html body .select-menu .option-item { min-height: 44px !important; padding: 10px !important; margin: 2px 0; gap: 8px; border: 1px solid transparent; border-radius: 8px; }
html body .select-menu .option-item > span:first-child { min-width: 0; flex: 1; white-space: normal; overflow-wrap: anywhere; }
html body .select-menu .option-item > span:last-child:not(:first-child) { max-width: 45%; white-space: normal; overflow-wrap: anywhere; font-size: 9px; padding: 3px 5px; }
html body .select-menu .option-item[aria-selected="true"] { background: var(--site-raised) !important; border-color: var(--site-border-strong) !important; }
html body .select-menu .search-input { font-size: 14px !important; }
html body .select-menu .kx-label-input { margin-top: 15px; }
html body .mg-group-card:focus-within, html body .mg-audit-card:focus-within { z-index: auto !important; }
html body .mg-group-card > *, html body .mg-audit-card > * { z-index: auto; }
html body .mg-group-card[data-card-glow]::after, html body .mg-audit-card[data-card-glow]::after { z-index: -1; }
/* Keep final transforms away from containing blocks for fixed UI. */
html body [data-site-main] { animation: kx-view-enter .4s var(--ui-ease) both !important; transform: none !important; filter: none !important; }
@keyframes kx-view-enter { from { opacity: .15; } to { opacity: 1; } }
.kx-reveal-card { animation: kx-card-enter .45s var(--ui-ease) both; }
@keyframes kx-card-enter { from { opacity:.25; } to { opacity:1; } }
.kx-brand-copy strong { font-size: 16px; letter-spacing: -.035em; white-space: nowrap; }
html body .kx-brand-copy small { font-size: 10px; }
html body .kx-sidebar-brand-name { font-size: 16px; white-space: nowrap; }
.kx-nav-brand img, .kx-sidebar-brand img, .kx-footer-brand img { border-radius: 9px; background: #050505; object-fit: contain; }
html body .kx-footer-brand strong { letter-spacing: -.03em; }
.kx-brand-logo { aspect-ratio: 1; object-fit: contain; background: #050505; border-radius: 12px; }
/* Page headers, grids and long content receive a deliberately separate mobile layout. */
@media (max-width:1023px) {
  html body [data-site-main] { padding-bottom: 30px; }
  html body .kx-label-input { --kx-field-height: 48px; }
  html body .kx-label-input .kx-label-control { font-size: 16px !important; }
  html body .select-trigger-label { font-size: 13px; }
  html body .kx-label-input:is(:focus-within,.is-always-floated,.is-filled) > .kx-floating-label { font-size: 11px !important; }
  html body [data-site-main] :is(.mg-operation-actions,.kx-action-group) { flex-wrap: wrap; }
  html body .kx-sidebar-brand-caption { font-size: 10px; }
}
@media (max-width:639px) {
  html body [data-site-main] h1 { white-space: normal !important; font-size: clamp(26px,7vw,34px) !important; line-height: 1.2 !important; }
  html body [data-site-main] :is(h2,h3) { white-space: normal; }
  html body .kx-brand-copy strong { font-size: 15px; }
  html body .kx-brand-copy small { font-size: 9px; }
  html body .kx-nav-shell { gap: 8px; }
  .mg-select-heading > span { font-size: 10px; }
  html body .select-menu .options-list { max-height: min(240px,42dvh); }
  html body [data-site-main] pre { max-width: 100%; overflow-x: auto; }
}
@media (max-width:359px) {
  html body .kx-navbar .kx-nav-brand { gap: 5px; }
  html body .kx-navbar .kx-brand-copy strong { font-size: 14px; }
  html body .kx-navbar .kx-nav-account-toggle { padding: 4px; }
}
@media (prefers-reduced-motion:reduce) {
  html body [data-site-main],html body [data-site-main] *,.kx-reveal-card { animation: none !important; transition: none !important; }
}
