/* ==========================================================================
   FreeToolBox Theme — Flat Minimal Green/Teal
   Design: Clean, utilitarian, sharp edges, no shadows, Swiss-style
   Palette: #10b981 (emerald) / #14b8a6 (teal)
   Mobile-first · Bootstrap 4 compatible · Dark mode support
   ========================================================================== */

/* ---------- CSS Custom Properties (Light) ---------- */
:root {
    --ft-primary: #10b981;
    --ft-primary-rgb: 16, 185, 129;
    --ft-secondary: #14b8a6;
    --ft-secondary-rgb: 20, 184, 166;
    --ft-accent: #14b8a6;
    --ft-accent-rgb: 20, 184, 166;
    --ft-bg: #fafbfc;
    --ft-surface: #ffffff;
    --ft-surface-alt: #f1f5f4;
    --ft-text: #111827;
    --ft-text-secondary: #374151;
    --ft-text-muted: #6b7280;
    --ft-text-light: #9ca3af;
    --ft-border: #e5e7eb;
    --ft-border-active: #10b981;
    --ft-radius: 0.5rem;
    --ft-radius-sm: 0.375rem;
    --ft-transition: 0.15s ease;
    --ft-mono: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
}

/* ---------- Dark Mode ---------- */
[data-theme-style="dark"] {
    --ft-bg: #0d1117;
    --ft-surface: #161b22;
    --ft-surface-alt: #1c2128;
    --ft-text: #e6edf3;
    --ft-text-secondary: #b1bac4;
    --ft-text-muted: #768390;
    --ft-text-light: #545d68;
    --ft-border: #30363d;
    --ft-border-active: #10b981;
}

/* ---------- Global Foundations ---------- */
html {
    scroll-behavior: smooth;
}

body {
    width: 100%;
    height: 100%;
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--ft-bg);
    color: var(--ft-text);
    line-height: 1.6;
    font-feature-settings: 'kern' 1, 'liga' 1;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ---------- Hero / Index Section — Clean Flat ---------- */
.index-background {
    background: var(--ft-primary);
    position: relative;
    overflow: hidden;
    border-radius: var(--ft-radius);
}

.index-background::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(160deg, rgba(20, 184, 166, 0.4) 0%, transparent 60%);
    pointer-events: none;
}

[data-theme-style="dark"] .index-background {
    background: #065f46;
}

.index-header {
    color: #ffffff;
    font-weight: 700;
    font-size: clamp(1.65rem, 3.5vw, 2.5rem);
    letter-spacing: -0.02em;
}

.index-subheader {
    color: rgba(255, 255, 255, 0.8);
    font-size: clamp(0.95rem, 1.8vw, 1.1rem);
    font-weight: 400;
    max-width: 560px;
}

.index-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    border-radius: var(--ft-radius);
    border: none;
    background: #ffffff;
    color: var(--ft-primary);
    transition: transform var(--ft-transition), box-shadow var(--ft-transition);
}

.index-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    color: var(--ft-accent);
}

.index-button:active {
    transform: translateY(0);
}

.index-cta {
    border-radius: var(--ft-radius);
    background: var(--ft-primary);
    overflow: hidden;
}

/* ---------- Cards — Flat, bordered, no shadow ---------- */
.card {
    background: var(--ft-surface);
    border: 1px solid var(--ft-border);
    border-radius: var(--ft-radius);
    box-shadow: none;
    transition: border-color var(--ft-transition);
}

.card:hover {
    border-color: var(--ft-primary);
}

.card-body {
    padding: 1.25rem;
}

@media (min-width: 768px) {
    .card-body {
        padding: 1.5rem;
    }
}

.card-header {
    background: var(--ft-surface-alt);
    border-bottom: 1px solid var(--ft-border);
    padding: 0.875rem 1.25rem;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--ft-text-muted);
}

/* ---------- Buttons — Flat, square-ish, functional ---------- */
.btn {
    border-radius: var(--ft-radius);
    font-weight: 500;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    transition: all var(--ft-transition);
    letter-spacing: 0.01em;
    box-shadow: none;
}

.btn-primary {
    background: var(--ft-primary);
    border: 1px solid var(--ft-primary);
    color: #ffffff;
}

.btn-primary:hover,
.btn-primary:focus {
    background: var(--ft-accent);
    border-color: var(--ft-accent);
    color: #ffffff;
    box-shadow: none;
}

.btn-primary:active {
    background: #047857;
    border-color: #047857;
    transform: none;
}

.btn-block {
    padding: 0.625rem 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.btn-outline-primary {
    color: var(--ft-primary);
    border: 1px solid var(--ft-primary);
    background: transparent;
}

.btn-outline-primary:hover {
    background: var(--ft-primary);
    color: #ffffff;
}

.btn-secondary {
    background: var(--ft-surface-alt);
    border: 1px solid var(--ft-border);
    color: var(--ft-text-secondary);
}

.btn-secondary:hover {
    background: var(--ft-border);
    color: var(--ft-text);
}

.btn-link {
    color: var(--ft-primary);
    text-decoration: none;
    padding: 0;
}

.btn-link:hover {
    color: var(--ft-accent);
    text-decoration: underline;
}

.btn-custom {
    padding: 0.4rem 1rem;
    color: var(--ft-text-muted);
    border-radius: var(--ft-radius);
    border: 1px solid var(--ft-border) !important;
    font-size: 0.85rem;
    font-weight: 500;
    background: var(--ft-surface);
    transition: all var(--ft-transition);
}

.btn-custom:hover {
    color: var(--ft-primary);
    border-color: var(--ft-primary) !important;
    background: var(--ft-surface);
}

.btn-custom.active {
    color: #ffffff;
    background: var(--ft-primary);
    border-color: var(--ft-primary) !important;
}

/* ---------- Forms — Clean, thin borders ---------- */
.form-control,
.custom-select {
    border-radius: var(--ft-radius);
    border: 1px solid var(--ft-border);
    background: var(--ft-surface);
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    transition: border-color var(--ft-transition);
    color: var(--ft-text);
}

.form-control:focus,
.custom-select:focus {
    border-color: var(--ft-primary);
    box-shadow: none;
    outline: none;
    background: var(--ft-surface);
}

.form-control::placeholder {
    color: var(--ft-text-light);
}

textarea.form-control {
    border-radius: var(--ft-radius);
    min-height: 100px;
    line-height: 1.6;
}

.form-group label {
    font-weight: 500;
    font-size: 0.8rem;
    color: var(--ft-text-secondary);
    margin-bottom: 0.375rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.form-group label i {
    color: var(--ft-primary) !important;
    font-size: 0.7rem;
}

.input-group-text {
    font-size: 0.875rem;
    border-radius: var(--ft-radius);
    background: var(--ft-surface-alt);
    border: 1px solid var(--ft-border);
    color: var(--ft-text-muted);
    font-weight: 500;
    font-family: var(--ft-mono);
    font-size: 0.8rem;
}

.input-group > .input-group-append > .btn {
    font-size: 0.875rem;
}

/* Custom checkbox — square, minimal */
.custom-control-input:checked ~ .custom-control-label::before {
    background-color: var(--ft-primary);
    border-color: var(--ft-primary);
    box-shadow: none;
}

.custom-control-input:focus ~ .custom-control-label::before {
    box-shadow: none;
    border-color: var(--ft-primary);
}

.custom-checkbox .custom-control-label::before {
    border-radius: var(--ft-radius-sm);
}

/* Range slider — minimal */
.form-control-range {
    -webkit-appearance: none;
    appearance: none;
    overflow: hidden;
    accent-color: var(--ft-primary);
    background: var(--ft-border);
    border-radius: 2px;
    height: 4px;
    margin: 0.75rem 0;
}

.form-control-range::-webkit-slider-runnable-track,
.form-control-range::-moz-range-track {
    background: var(--ft-border);
}

.form-control-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    height: 14px;
    width: 14px;
    background: var(--ft-primary);
    border-radius: 50%;
    border: 2px solid var(--ft-surface);
    box-shadow: -2007px 0 0 2000px var(--ft-primary);
    cursor: pointer;
}

.form-control-range::-moz-range-thumb {
    -webkit-appearance: none;
    appearance: none;
    height: 14px;
    width: 14px;
    background: var(--ft-primary);
    border-radius: 50%;
    border: 2px solid var(--ft-surface);
    box-shadow: -2007px 0 0 2000px var(--ft-primary);
    cursor: pointer;
}

/* Custom radio boxes — clean bordered */
.custom-radio-box {
    cursor: pointer;
}

.custom-radio-box .custom-radio-box-main-text {
    font-size: 1rem;
    font-weight: 600;
}

.custom-radio-box .custom-radio-box-main-icon {
    font-size: 1.125rem;
    color: var(--ft-primary);
}

.custom-radio-box input[type="radio"] + div,
.custom-radio-box input[type="checkbox"] + div {
    transition: border-color var(--ft-transition), background var(--ft-transition);
    border: 1px solid var(--ft-border);
    background: var(--ft-surface);
    border-radius: var(--ft-radius);
}

.custom-radio-box input[type="radio"]:checked + div,
.custom-radio-box input[type="checkbox"]:checked + div {
    border-color: var(--ft-primary);
    background: rgba(var(--ft-primary-rgb), 0.04);
}

.custom-radio-box input[type="radio"]:hover + div,
.custom-radio-box input[type="checkbox"]:hover + div {
    border-color: var(--ft-secondary);
}

/* ---------- Navbar — Flat, bottom-border only ---------- */
.navbar-main {
    padding: 0.5rem 1rem;
    background: var(--ft-surface);
    border-bottom: 1px solid var(--ft-border);
    box-shadow: none;
}

.navbar-nav > li {
    font-size: 0.85rem;
    font-weight: 500;
}

.navbar-expand-lg .navbar-nav .nav-link {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    color: var(--ft-text-muted);
    transition: color var(--ft-transition);
    border-bottom: 2px solid transparent;
    border-radius: 0;
}

@media (min-width: 992px) {
    .navbar-expand-lg .navbar-nav .nav-link {
        padding-right: 0.875rem;
        padding-left: 0.875rem;
    }
}

.navbar-expand-lg .navbar-nav .nav-link:hover {
    color: var(--ft-primary);
}

.navbar-expand-lg .navbar-nav .nav-link.active {
    color: var(--ft-primary);
    border-bottom-color: var(--ft-primary);
    background: none;
}

.navbar-logo {
    max-height: 2rem;
    height: 2rem;
}

.navbar-logo-mini {
    max-height: 1.125rem;
    height: 1.125rem;
}

.navbar-avatar {
    width: 20px;
    height: 20px;
    border-radius: var(--ft-radius-sm);
}

.navbar-custom-toggler {
    padding: 0.375rem 0.625rem;
    font-size: 1.125rem;
    line-height: 1;
    background-color: transparent;
    border-radius: var(--ft-radius);
    color: var(--ft-text-muted);
    border-color: var(--ft-border);
}

.navbar-custom-toggler:hover {
    color: var(--ft-primary);
    border-color: var(--ft-primary);
}

/* ---------- Dropdown — Clean, no animation ---------- */
.dropdown-item {
    color: var(--ft-text);
    font-weight: 450;
    font-size: 0.85rem;
    padding: 0.4rem 0.75rem;
    border-radius: var(--ft-radius-sm);
    transition: background var(--ft-transition);
}

.dropdown-item:hover,
.dropdown-item:focus {
    background: var(--ft-surface-alt);
    color: var(--ft-text);
}

.dropdown-item.active,
.dropdown-item:active {
    background: var(--ft-primary);
    color: #ffffff;
    border-radius: var(--ft-radius-sm);
}

.dropdown-item svg {
    color: var(--ft-text-light);
}

.dropdown-item:active svg,
.dropdown-item.active svg {
    color: #ffffff;
}

.dropdown-menu {
    border-radius: var(--ft-radius);
    border: 1px solid var(--ft-border);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    padding: 0.25rem;
    background: var(--ft-surface);
    margin-top: 0.25rem;
}

/* ---------- Footer — Minimal, top-border only ---------- */
.app-footer {
    margin: 3rem 0;
    padding: 1.25rem;
    border: none;
    border-top: 1px solid var(--ft-border);
    font-size: 0.85rem;
    background: transparent;
    border-radius: 0;
    color: var(--ft-text-muted);
}

.app-footer a:not(.dropdown-item),
.app-footer a:hover:not(.dropdown-item) {
    color: var(--ft-text-muted);
}

.app-footer a:hover:not(.dropdown-item) {
    color: var(--ft-primary);
    text-decoration: underline;
}

.app-footer a.icon {
    color: var(--ft-text-muted);
}

.app-footer button,
.app-footer button:hover {
    color: var(--ft-text-muted);
}

.footer-logo {
    max-height: 2rem;
    height: 2rem;
}

.footer-heading {
    color: var(--ft-text) !important;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.footer-social-wrapper {
    border-radius: var(--ft-radius);
    aspect-ratio: 1 / 1;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 2.25rem;
    height: 2.25rem;
    border: 1px solid var(--ft-border);
    transition: border-color var(--ft-transition);
}

.footer-social-wrapper:hover {
    border-color: var(--ft-primary);
}

.footer-social-wrapper:hover a {
    color: var(--ft-primary) !important;
}

.footer-social-wrapper a {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--ft-text-muted);
}

/* ---------- Breadcrumbs — Slash separated, inline ---------- */
.custom-breadcrumbs {
    list-style: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    font-size: 0.8rem;
}

.custom-breadcrumbs > li {
    margin-right: 0.25rem;
}

.custom-breadcrumbs > li > a {
    color: var(--ft-text-muted);
    text-decoration: none;
}

.custom-breadcrumbs > li > a:hover {
    color: var(--ft-primary);
    text-decoration: underline;
}

.custom-breadcrumbs > li > svg {
    color: var(--ft-text-light);
    margin-left: 0.25rem;
    font-size: 0.7rem;
}

/* ---------- Modals — Flat, sharp ---------- */
.modal-header {
    padding: 1rem;
    border-bottom: 1px solid var(--ft-border);
}

.modal-content {
    padding: 0;
    border: 1px solid var(--ft-border);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-radius: var(--ft-radius);
    background: var(--ft-surface);
}

.modal-body {
    padding: 1.25rem;
}

.modal-footer {
    border-top: 1px solid var(--ft-border);
    padding: 1rem;
}

/* ---------- Tables — Minimal lines ---------- */
.table-custom-container {
    border-radius: var(--ft-radius);
    border: 1px solid var(--ft-border);
    overflow: hidden;
}

.table-custom {
    margin-bottom: 0;
    background: var(--ft-surface);
}

.table-custom thead th {
    border-top: 0;
    border-bottom: 1px solid var(--ft-border);
    color: var(--ft-text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.75rem 1rem;
    background: var(--ft-surface-alt);
}

[data-theme-style="dark"] .table-custom thead th {
    color: var(--ft-text-muted);
}

.table-custom td {
    padding: 0.875rem 1rem;
    vertical-align: middle;
    font-size: 0.875rem;
}

.table-custom tbody tr td {
    border-top: 1px solid var(--ft-border);
}

[data-theme-style="dark"] .table-custom tbody tr td {
    border-color: var(--ft-border);
}

.table-custom tbody tr {
    transition: background var(--ft-transition);
}

.table-custom tbody tr:hover td {
    background: var(--ft-surface-alt);
}

.table-image-wrapper {
    border-radius: var(--ft-radius);
    width: 2.25rem;
    height: 2.25rem;
    max-width: 2.25rem;
    max-height: 2.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(var(--ft-primary-rgb), 0.08);
    color: var(--ft-primary);
}

/* ---------- Filters ---------- */
.filters-dropdown {
    width: 18rem;
    max-height: 30rem;
    overflow-y: auto;
}

/* ---------- Toolkit Specific ---------- */
.tool-icon {
    min-width: 2.5rem;
    max-height: 2.5rem;
    width: 2.5rem;
    height: 2.5rem;
}

.tool-icon-wrapper {
    padding: 0 1rem;
}

/* ---------- Canvas ---------- */
canvas {
    -moz-user-select: none;
    -webkit-user-select: none;
    -ms-user-select: none;
}

/* ---------- Chart Container ---------- */
.chart-container {
    position: relative;
    margin: auto;
    height: 275px;
    width: 100%;
}

@media print {
    .chart-container canvas {
        min-height: 100%;
        max-width: 100%;
        max-height: 100%;
        height: auto !important;
        width: auto !important;
    }
}

/* ---------- Pricing ---------- */
.pricing-tag {
    position: absolute;
    font-size: 0.7rem;
    font-weight: 600;
    background: var(--ft-primary);
    color: #ffffff;
    padding: 0.125rem 0.625rem;
    border-radius: var(--ft-radius-sm);
    top: 0;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ---------- Round Circles ---------- */
.round-circle-md {
    width: 2.25rem;
    height: 2.25rem;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: var(--ft-radius);
    background: rgba(var(--ft-primary-rgb), 0.08);
}

.round-circle-lg {
    width: 4rem;
    height: 4rem;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: var(--ft-radius);
    background: rgba(var(--ft-primary-rgb), 0.08);
}

/* ---------- User Avatar ---------- */
.user-avatar {
    border-radius: var(--ft-radius);
    max-width: 70px;
    max-height: 70px;
}

/* ---------- Disabled States ---------- */
.container-disabled {
    pointer-events: none;
    opacity: 0.4;
}

.container-disabled-simple {
    pointer-events: none;
}

/* ---------- Blog ---------- */
.blog-post-image {
    max-height: 20rem;
    object-fit: cover;
    border-radius: var(--ft-radius);
}

.blog-post-image-small {
    height: 13rem;
    max-height: 13rem;
    object-fit: cover;
    border-radius: var(--ft-radius);
}

.blog-post-content {
    line-height: 1.8;
    word-break: break-word;
    color: var(--ft-text-secondary);
}

.blog-post-content p {
    margin-bottom: 1.25rem;
}

/* ---------- Code Blocks — Terminal-style ---------- */
.ql-code-block {
    background-color: var(--ft-surface-alt);
    color: var(--ft-text);
    padding: 1rem;
    border-radius: var(--ft-radius);
    overflow-x: auto;
    font-family: var(--ft-mono);
    white-space: pre;
    font-size: 0.8rem;
    line-height: 1.6;
    border: 1px solid var(--ft-border);
}

.ql-content p {
    margin-bottom: 0 !important;
}

.ql-content li[data-list="bullet"] {
    list-style-type: disc;
}

blockquote {
    border-left: 3px solid var(--ft-primary);
    padding: 0.75rem 1rem;
    margin: 1.25rem 0;
    background: transparent;
    font-style: normal;
    color: var(--ft-text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    border-radius: 0;
}

.shiki {
    overflow: auto;
    border-radius: var(--ft-radius);
    padding: 1rem;
    font-size: 0.8rem;
    line-height: 1.6;
    border: 1px solid var(--ft-border);
}

.shiki code {
    background: initial !important;
}

/* ---------- File Input — Simple ---------- */
.altum-file-input {
    padding: 0.75rem;
    background: var(--ft-surface);
    border: 1px solid var(--ft-border);
    border-radius: var(--ft-radius);
    cursor: pointer;
    font-size: 0.85rem;
}

.altum-file-input:hover {
    border-color: var(--ft-primary);
}

.altum-file-input::file-selector-button {
    border: 1px solid var(--ft-border);
    padding: 0.3rem 0.625rem;
    border-radius: var(--ft-radius-sm);
    background-color: var(--ft-surface-alt);
    cursor: pointer;
    font-size: 0.8rem;
    margin-right: 0.75rem;
    color: var(--ft-text-secondary);
}

.altum-file-input-preview {
    max-width: 100%;
    max-height: 68px;
    min-height: 68px;
    object-fit: cover;
    border-radius: var(--ft-radius);
}

/* ---------- Sticky ---------- */
.sticky {
    position: sticky !important;
    top: 1rem;
    height: min-content;
}

/* ---------- Animations — Subtle, functional only ---------- */
a svg {
    transition: color var(--ft-transition);
}

a:hover svg {
    color: var(--ft-primary);
    transform: none;
}

a:active svg {
    transform: none;
}

[data-theme-style="dark"] svg[data-custom-colors] {
    color: var(--brand-color-dark) !important;
}

.icon-zoom-animation svg {
    transition: color var(--ft-transition);
}

.icon-zoom-animation:hover svg {
    color: var(--ft-primary);
    transform: none;
}

/* No zoom — just color shift */
.zoom-animation {
    transition: opacity var(--ft-transition);
}

.zoom-animation:hover {
    opacity: 0.85;
    transform: none;
}

.zoom-animation:active {
    opacity: 0.7;
    transform: none;
}

.zoom-animation-subtle {
    transition: opacity var(--ft-transition);
}

.zoom-animation-subtle:hover {
    opacity: 0.9;
    transform: none;
}

.zoom-animation-subtle-active:active {
    opacity: 0.75;
}

/* Up animation replaced with border-left accent */
.up-animation {
    transition: border-color var(--ft-transition), background var(--ft-transition);
    border-left: 3px solid transparent;
}

.up-animation:hover {
    border-left-color: var(--ft-primary);
    background: rgba(var(--ft-primary-rgb), 0.02);
    transform: none;
}

/* ---------- Base Animation ---------- */
.altum-animate {
    -webkit-animation-duration: 300ms;
    animation-duration: 300ms;
}

.altum-animate-fill-both {
    -webkit-animation-fill-mode: both;
    animation-fill-mode: both;
}

.altum-animate-fill-none {
    -webkit-animation-fill-mode: none;
    animation-fill-mode: none;
}

@keyframes fadeIn {
    0% { opacity: 0; }
    to { opacity: 1; }
}

.altum-animate-fade-in {
    -webkit-animation-name: fadeIn;
    animation-name: fadeIn;
}

/* ---------- Color Picker ---------- */
@media print {
    .pcr-app {
        display: none;
    }
}

.pcr-button {
    border: 1px solid var(--ft-surface) !important;
    outline: 1px solid var(--ft-border) !important;
    height: calc(var(--input-padding-y) + var(--input-padding-x) + var(--input-font-size) + calc(var(--input-font-size) / 2.75)) !important;
    border-radius: var(--ft-radius) !important;
    width: 100% !important;
}

.pcr-button::before,
.pcr-button::after {
    border-radius: var(--ft-radius) !important;
}

/* ---------- Btn Group — Segmented control ---------- */
.btn-group-custom {
    border: 1px solid var(--ft-border);
    padding: 0.25rem;
    border-radius: var(--ft-radius);
    flex-wrap: wrap;
    display: inline-flex;
    gap: 0.125rem;
    background: var(--ft-surface-alt);
}

.btn-group-custom .btn {
    border-radius: var(--ft-radius-sm) !important;
    background: transparent;
    border: none;
    font-size: 0.8rem;
    padding: 0.3rem 0.75rem;
    color: var(--ft-text-muted);
}

.btn-group-custom .btn:hover {
    color: var(--ft-text);
}

.btn-group-custom .btn.active {
    background: var(--ft-surface);
    color: var(--ft-primary);
    z-index: 0 !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    font-weight: 600;
}

/* ---------- Scrollbar — Thin, muted ---------- */
body * {
    scrollbar-color: var(--ft-border) transparent !important;
    scrollbar-width: thin !important;
}

body *::-webkit-scrollbar-thumb {
    background: var(--ft-border);
    border-radius: 0;
    width: 4px;
    height: 4px;
}

body *::-webkit-scrollbar,
body *::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 0;
    width: 4px;
    height: 4px;
}

/* ---------- Notifications ---------- */
.internal-notification-icon {
    animation: ft-dot-pulse 2s infinite;
}

@keyframes ft-dot-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* ---------- Teams ---------- */
.team-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--ft-radius);
}

.team-delegate-access-wrapper {
    margin: 0.75rem;
    border-radius: var(--ft-radius);
    border: 1px solid var(--ft-border);
}

@media (min-width: 992px) {
    .team-delegate-access-wrapper {
        border-radius: var(--ft-radius);
    }
}

/* ---------- Announcements ---------- */
.announcement-wrapper {
    position: relative;
    z-index: 10;
    margin: 0.5rem 0.75rem;
    border-radius: var(--ft-radius);
    opacity: 0;
    transition: opacity 0.2s ease;
    animation: ft-slide-down 0.2s ease 0.4s forwards;
    border: 1px solid var(--ft-border);
}

@media (min-width: 992px) {
    .announcement-wrapper {
        border-radius: var(--ft-radius);
    }
}

@keyframes ft-slide-down {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ---------- PWA ---------- */
.pwa-wrapper {
    position: fixed;
    bottom: 0;
    width: calc(100% - 1.5rem);
    z-index: 1000;
    background: var(--ft-surface);
    border-top: 1px solid var(--ft-border);
}

[data-theme-style="dark"] .pwa-wrapper {
    background: var(--ft-surface);
}

/* ---------- Helper Classes ---------- */
.user-select-none {
    user-select: none;
}

.font-size-little-small {
    font-size: 0.875rem;
}

.font-size-small {
    font-size: 0.8rem;
}

.font-weight-450 {
    font-weight: 450;
}

.font-weight-500 {
    font-weight: 500;
}

.font-weight-600 {
    font-weight: 600;
}

.cursor-grab {
    cursor: grab !important;
}

.list-style-none {
    list-style: none;
    padding: 0;
}

.cursor-pointer {
    cursor: pointer;
}

.no-focus:focus {
    outline: 0;
    box-shadow: none;
}

.appearance-none {
    appearance: none;
    -moz-appearance: none;
    -webkit-appearance: none;
}

img {
    vertical-align: inherit !important;
}

.icon-favicon {
    width: 0.85rem;
    height: auto;
}

.icon-favicon-small {
    width: 0.7rem;
    height: auto;
}

.w-fit-content {
    width: fit-content !important;
}

.rounded-2x {
    border-radius: calc(2 * var(--ft-radius));
}

.rounded-3x {
    border-radius: calc(3 * var(--ft-radius));
}

.api-widget-icon {
    width: 2.25rem;
    height: 2.25rem;
}

.pointer-events-all {
    pointer-events: all !important;
}

/* ---------- FontAwesome layout shift prevention ---------- */
i.fa-fw {
    width: 1.25em;
    display: inline-block;
}

i.fa-xs {
    font-size: 0.85em;
}

i.fa-sm {
    font-size: 0.875em;
}

i.fa-lg {
    font-size: 1.25em;
}

i.xl {
    font-size: 1.5em;
}

/* ---------- AI Chat ---------- */
.ai-chat-avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--ft-radius);
}

.ai-chat-big-avatar {
    width: 48px;
    height: 48px;
    border-radius: var(--ft-radius);
}

.chat-messages {
    height: 25rem;
    overflow-y: scroll;
    background: var(--ft-surface-alt);
    border: 1px solid var(--ft-border);
    border-radius: var(--ft-radius);
}

.chat-image > img {
    max-height: 15rem;
    border-radius: var(--ft-radius);
}

.chat-content {
    word-break: break-word;
}

/* ---------- Cryptocurrency ---------- */
.cryptocurrency-icon {
    width: 36px;
    height: 36px;
}

/* ---------- Invoice ---------- */
.invoice-table th {
    border-top: 0 !important;
}

.invoice-table td {
    vertical-align: baseline !important;
}

@media print {
    .invoice {
        page-break-after: always;
    }

    body, html, .container {
        height: auto !important;
        overflow: visible !important;
    }

    .invoice-logo {
        filter: grayscale(100%);
    }
}

/* ---------- Ratings — Simple, no glow ---------- */
.rating-star {
    cursor: pointer;
}

.rating-star svg {
    color: #fbbf24;
    transition: color var(--ft-transition);
}

.rating-star:hover svg,
.rating-star:hover ~ .rating-star svg {
    color: #f59e0b !important;
}

.rating-star-chosen svg,
.rating-star-chosen ~ .rating-star svg {
    color: #d97706;
}

/* ---------- Signatures ---------- */
.signature-avatar {
    width: 48px;
    height: 48px;
    max-width: 48px;
    max-height: 48px;
    border-radius: var(--ft-radius);
}

/* ---------- Loading Overlay ---------- */
.loading-overlay {
    padding: 1rem;
    border-radius: var(--ft-radius);
    display: flex;
    justify-content: center;
    align-items: center;
    position: absolute;
    width: 100%;
    height: 100%;
    background: var(--ft-surface);
    z-index: 100;
    opacity: 0.85;
}

[data-theme-style="dark"] .loading-overlay {
    background: var(--ft-surface);
}

/* ---------- Selection ---------- */
::selection {
    background: rgba(var(--ft-primary-rgb), 0.15);
}

/* ---------- prefers-color-scheme Dark Mode ---------- */
@media (prefers-color-scheme: dark) {
    :root {
        --ft-bg: #0d1117;
        --ft-surface: #161b22;
        --ft-surface-alt: #1c2128;
        --ft-text: #e6edf3;
        --ft-text-secondary: #b1bac4;
        --ft-text-muted: #768390;
        --ft-text-light: #545d68;
        --ft-border: #30363d;
        --ft-border-active: #10b981;
    }

    .index-background {
        background: #065f46;
    }

    .ql-code-block {
        background-color: #1c2128;
    }
}

/* ---------- Focus Visible ---------- */
:focus-visible {
    outline: 2px solid var(--ft-primary);
    outline-offset: 1px;
}
