/*
    Portalapp shared theme layer
    Custom CSS system first, Tailwind legacy support second.
*/

:root {
    --background: 0 0% 4%;
    --foreground: 39 45% 92%;
    --card: 0 0% 8%;
    --card-foreground: 39 45% 92%;
    --popover: 0 0% 8%;
    --popover-foreground: 39 45% 92%;
    --primary: 37 68% 75%;
    --primary-foreground: 0 0% 5%;
    --secondary: 0 0% 12%;
    --secondary-foreground: 39 45% 92%;
    --muted: 0 0% 12%;
    --muted-foreground: 39 8% 66%;
    --accent: 0 0% 14%;
    --accent-foreground: 39 45% 92%;
    --destructive: 0 68.7% 70%;
    --destructive-foreground: 0 0% 100%;
    --border: 0 0% 18%;
    --input: 0 0% 18%;
    --ring: 37 68% 75%;

    --radius: 0.375rem;
    --radius-sm: 0.375rem;
    --radius-md: 0.375rem;
    --radius-lg: 0.375rem;
    --radius-xl: 0.375rem;

    --shadow-soft: 0 1px 2px rgb(0 0 0 / 0.24), 0 10px 30px rgb(0 0 0 / 0.18);
    --shadow-panel: 0 1px 1px rgb(0 0 0 / 0.18), 0 12px 34px rgb(0 0 0 / 0.22);

    --canvas: 0 0% 4%;
    --canvas-soft: 0 0% 6%;
    --surface-card: 0 0% 8%;
    --surface-strong: 0 0% 12%;
    --ink: 39 45% 92%;
    --body: 39 8% 66%;
    --body-strong: 39 45% 92%;
    --muted-soft: 39 8% 72%;
    --border-soft: 0 0% 14%;
    --border-strong: 0 0% 24%;
    --success: 150 52% 45%;
    --warning: 38 70% 58%;
    --info: 214 52% 62%;

    --gray-50: 0 0% 8%;
    --gray-100: 0 0% 12%;
    --gray-200: 0 0% 16%;
    --gray-300: 0 0% 22%;
    --gray-400: 39 8% 58%;
    --gray-500: 39 8% 66%;
    --gray-600: 39 8% 74%;
    --gray-700: 39 45% 86%;
    --gray-800: 39 45% 90%;
    --gray-900: 39 45% 92%;
    --gray-950: 39 45% 94%;

    --emerald-50: 148 18% 18%;
    --emerald-200: 149 20% 25%;
    --emerald-700: 149 45% 72%;
    --amber-50: 40 18% 16%;
    --amber-200: 39 28% 26%;
    --amber-700: 39 76% 74%;
    --red-50: 353 18% 18%;
    --red-200: 350 25% 26%;
    --red-700: 346 68% 74%;
    --blue-50: 214 18% 18%;
    --blue-200: 214 25% 26%;
    --blue-700: 214 72% 80%;

    --font-poppins: "Poppins", system-ui, sans-serif;
    --font-jetbrains-mono: "Poppins", system-ui, sans-serif;
    --font-family: var(--font-poppins);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    color-scheme: dark;
    text-size-adjust: 100%;
    -webkit-text-size-adjust: 100%;
    font-size: 15px;
}

html {
    scrollbar-width: thin;
    scrollbar-color: rgb(237 201 158 / 0.72) rgb(255 255 255 / 0.04);
}

html::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

html::-webkit-scrollbar-track {
    background: rgb(255 255 255 / 0.04);
}

html::-webkit-scrollbar-thumb {
    border: 2px solid transparent;
    border-radius: 9999px;
    background-clip: padding-box;
    background: linear-gradient(180deg, rgb(237 201 158 / 0.8), rgb(190 152 92 / 0.72));
    box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.22);
}

html::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgb(243 212 171 / 0.92), rgb(201 160 94 / 0.9));
}

html::-webkit-scrollbar-corner {
    background: transparent;
}

body {
    margin: 0;
    background:
        radial-gradient(circle at top, rgb(237 201 158 / 0.1), transparent 38%),
        radial-gradient(circle at bottom right, rgb(255 255 255 / 0.04), transparent 24%),
        linear-gradient(180deg, hsl(var(--background)), hsl(var(--canvas)));
    color: hsl(var(--foreground));
    font-family: var(--font-family), Inter, ui-sans-serif, system-ui, sans-serif;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img,
svg,
video,
canvas {
    display: block;
    max-width: 100%;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

::selection {
    background: hsl(var(--primary) / 0.16);
    color: hsl(var(--foreground));
}

:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px hsl(var(--ring) / 0.18);
}

hr {
    border-color: hsl(var(--border));
}

code,
pre,
kbd,
samp {
    font-family: var(--font-jetbrains-mono);
}

/* Shared layout surfaces */
.shadow-soft {
    box-shadow: var(--shadow-soft);
}

.s-card {
    border: 1px solid hsl(var(--border));
    background: linear-gradient(180deg, hsl(var(--card) / 0.94), hsl(var(--background) / 0.94));
    border-radius: calc(var(--radius-lg) + 0.125rem);
    box-shadow: 0 1px 1px rgb(0 0 0 / 0.12), 0 8px 22px rgb(0 0 0 / 0.12);
}

.s-input,
.s-textarea,
.s-select,
.acc-select-btn {
    border: 1px solid hsl(var(--border));
    background: hsl(var(--background));
    color: hsl(var(--foreground));
    border-radius: calc(var(--radius-md) + 0.125rem);
    transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.s-input:focus,
.s-textarea:focus,
.s-select:focus,
.acc-select-btn:focus-visible {
    border-color: hsl(var(--ring));
    box-shadow: 0 0 0 3px hsl(var(--ring) / 0.12);
}

.btn,
.btn-icon,
.cust-trigger,
.mode-btn,
.seg-btn {
    border: 1px solid hsl(var(--border));
    color: hsl(var(--foreground));
    border-radius: calc(var(--radius) + 0.125rem);
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, opacity 0.15s ease, box-shadow 0.15s ease;
}

.cust-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 2.75rem;
    padding: 0.625rem 0.875rem;
    background: hsl(var(--card) / 0.9);
    box-shadow: 0 1px 1px rgb(0 0 0 / 0.12), 0 10px 22px rgb(0 0 0 / 0.12);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.app-page {
    min-height: 100vh;
    background: hsl(var(--background));
    color: hsl(var(--foreground));
}

.app-center {
    display: flex;
    min-height: 100vh;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.app-overlay {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgb(0 0 0 / 0.86);
}

.app-shell {
    width: 100%;
}

.app-panel {
    overflow: hidden;
    border: 1px solid rgb(129 121 121 / 0.12);
    border-radius: var(--radius);
    background: hsl(var(--card));
    box-shadow:
        0 18px 52px rgb(0 0 0 / 0.32),
        inset 0 1px 0 rgb(255 255 255 / 0.02);
}

.app-panel--wide {
    width: min(100%, 64rem);
    margin-inline: auto;
}

.app-panel--modal {
    width: min(100%, 34rem);
    margin-inline: auto;
    background: hsl(var(--card));
}

.app-page-wrap {
    width: min(100%, 34rem);
    margin-inline: auto;
    padding-block: 2.5rem;
}

.app-page-wrap--lg {
    width: min(100%, 40rem);
}

.app-content-shell {
    width: min(100%, 90rem);
    margin-inline: auto;
    padding: 1.5rem 1rem 4rem;
}

.app-content-shell--flush {
    width: 100%;
    padding-inline: 0;
}

.app-panel__header,
.app-panel__footer {
    padding: 1.5rem 1.5rem 1.25rem;
    border-color: rgb(129 121 121 / 0.08);
}

.app-panel__header {
    border-bottom: 1px solid rgb(129 121 121 / 0.08);
}

.app-panel__footer {
    border-top: 1px solid rgb(129 121 121 / 0.08);
}

.app-panel__body {
    padding: 1.5rem;
}

.app-icon-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: var(--radius);
    border: 1px solid rgb(237 201 158 / 0.18);
    background: rgb(237 201 158 / 0.1);
    color: rgb(237 201 158);
    box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.06);
}

.app-title {
    margin: 0;
    font-size: clamp(1.25rem, 1.05rem + 1vw, 1.875rem);
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: hsl(var(--foreground));
}

.app-copy {
    margin: 0;
    color: hsl(var(--muted-foreground));
    line-height: 1.65;
}

.app-copy--tight {
    line-height: 1.45;
}

.app-copy--muted {
    color: hsl(var(--muted-foreground));
}

.app-stack {
    display: grid;
    gap: 0.75rem;
}

.app-stack--lg {
    gap: 1rem;
}

.app-doc-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
}

.app-section {
    display: grid;
    gap: 1rem;
    margin-top: 3rem;
}

.app-section--tight {
    gap: 0.75rem;
    margin-top: 2rem;
}

.app-section__head {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    justify-content: space-between;
    gap: 0.875rem;
}

.app-section__title {
    margin: 0;
    font-size: clamp(1.5rem, 1.2rem + 1vw, 2.125rem);
    line-height: 1.15;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: hsl(var(--foreground));
}

.app-section__title--sm {
    font-size: 1.25rem;
}

.app-section__eyebrow {
    margin: 0;
    color: hsl(var(--muted-foreground));
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.app-section__description {
    margin: 0;
    max-width: 42rem;
    color: hsl(var(--muted-foreground));
    line-height: 1.65;
}

.app-section__action {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: hsl(var(--foreground));
    font-size: 0.9rem;
    font-weight: 700;
}

.app-section__action:hover {
    color: rgb(246 217 181);
}

.app-hero-card {
    border: 1px solid rgb(129 121 121 / 0.16);
    border-radius: var(--radius);
    background:
        linear-gradient(180deg, rgb(255 255 255 / 0.02), rgb(255 255 255 / 0.01)),
        linear-gradient(180deg, hsl(var(--card) / 0.96), hsl(var(--background) / 0.96));
    box-shadow: var(--shadow-panel);
}

.app-hero-card__content {
    padding: clamp(1.25rem, 1rem + 1vw, 2rem);
}

.app-grid--4 {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
}

.app-grid--2 {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
}

.app-stat-card {
    display: grid;
    gap: 0.75rem;
    padding: 1.25rem;
    border: 1px solid rgb(129 121 121 / 0.14);
    border-radius: var(--radius);
    background: linear-gradient(180deg, rgb(255 255 255 / 0.025), rgb(255 255 255 / 0.012));
    box-shadow: var(--shadow-panel);
}

.app-stat-label {
    margin: 0;
    color: hsl(var(--muted-foreground));
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.app-stat-value {
    margin: 0;
    color: hsl(var(--foreground));
    font-size: clamp(1.5rem, 1.1rem + 1vw, 2.25rem);
    line-height: 1.1;
    font-weight: 800;
}

.app-feature-card {
    display: grid;
    gap: 0.75rem;
    padding: 1.25rem;
    border: 1px solid rgb(129 121 121 / 0.14);
    border-radius: var(--radius);
    background: linear-gradient(180deg, rgb(255 255 255 / 0.025), rgb(255 255 255 / 0.012));
    box-shadow: var(--shadow-panel);
}

.app-feature-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: var(--radius);
    background: hsl(var(--muted));
    color: hsl(var(--foreground));
}

.app-feature-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: hsl(var(--foreground));
}

.app-feature-copy {
    margin: 0;
    color: hsl(var(--muted-foreground));
    line-height: 1.65;
}

.app-product-card {
    display: flex;
    height: 100%;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgb(129 121 121 / 0.14);
    border-radius: var(--radius);
    background: linear-gradient(180deg, rgb(255 255 255 / 0.025), rgb(255 255 255 / 0.012));
    box-shadow: var(--shadow-panel);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.app-product-card:hover {
    border-color: rgb(237 201 158 / 0.18);
    box-shadow: 0 18px 38px rgb(0 0 0 / 0.24);
}

.app-product-card__media {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: hsl(var(--muted));
}

.app-product-card--compact .app-product-card__media {
    aspect-ratio: 16 / 9;
}

.app-product-card__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.app-product-card__image--compact {
    object-position: center top;
}

.app-product-card:hover .app-product-card__image {
    transform: scale(1.05);
}

.app-product-card__placeholder {
    display: flex;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    color: hsl(var(--muted-foreground));
}

.app-product-card__placeholder--compact {
    min-height: 10rem;
}

.app-product-card__placeholder-icon {
    font-size: 1.875rem;
}

.app-product-card__badge-row {
    position: absolute;
    left: 0.75rem;
    top: 0.75rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.app-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    min-height: 1.5rem;
    padding: 0.3rem 0.6rem;
    border-radius: 9999px;
    background: rgb(255 255 255 / 0.1);
    color: hsl(var(--foreground));
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    backdrop-filter: blur(10px);
}

.app-badge--dark {
    background: rgb(0 0 0 / 0.45);
    color: white;
}

.app-badge--primary {
    background: rgb(237 201 158 / 0.18);
    color: rgb(246 217 181);
}

.app-badge--success {
    background: rgb(34 197 94 / 0.12);
    color: rgb(134 239 172);
}

.app-badge--info {
    background: rgb(59 130 246 / 0.12);
    color: rgb(191 219 254);
}

.app-badge--warning {
    background: rgb(245 158 11 / 0.12);
    color: rgb(253 224 71);
}

.app-badge--danger {
    background: rgb(239 68 68 / 0.12);
    color: rgb(248 113 113);
}

.app-product-card__body {
    display: grid;
    gap: 0.85rem;
    padding: 1rem;
}

.app-product-card__body--compact {
    gap: 0.65rem;
    padding: 0.85rem;
}

.app-product-card__category {
    margin: 0;
    color: hsl(var(--muted-foreground));
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.app-product-card__title {
    margin: 0;
    color: hsl(var(--foreground));
    font-size: 1rem;
    line-height: 1.35;
    font-weight: 800;
    min-width: 0;
}

.app-product-card__title--compact {
    font-size: 0.9rem;
    line-height: 1.25;
}

.app-product-card__title a {
    color: inherit;
}

.app-marquee {
    position: relative;
    overflow: hidden;
    display: block;
    white-space: nowrap;
}

.app-marquee__track {
    display: inline-flex;
    min-width: 100%;
    width: max-content;
    align-items: center;
    gap: 2rem;
    will-change: transform;
    animation: marqueeScroll 11s linear infinite;
}

.app-marquee__track > span {
    display: inline-block;
}

.app-marquee:hover .app-marquee__track,
.app-marquee:focus-within .app-marquee__track {
    animation-play-state: paused;
}

@keyframes marqueeScroll {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

.app-product-card__price {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.app-product-card__price--compact {
    gap: 0.35rem;
}

.app-product-card__price-current {
    color: hsl(var(--foreground));
    font-size: 1.15rem;
    font-weight: 800;
}

.app-product-card__price--compact .app-product-card__price-current {
    font-size: 0.95rem;
}

.app-product-card__price-compare {
    color: hsl(var(--muted-foreground));
    font-size: 0.85rem;
    text-decoration: line-through;
}

.app-product-card__meta {
    color: hsl(var(--muted-foreground));
    font-size: 0.75rem;
}

.app-product-card__meta--compact {
    font-size: 0.7rem;
}

.app-product-card__actions {
    display: grid;
    gap: 0.5rem;
    grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
    margin-top: auto;
}

.app-product-card__actions--compact {
    gap: 0.4rem;
    grid-template-columns: 1fr;
}

.app-category-card {
    display: grid;
    gap: 0.75rem;
    padding: 1.25rem;
    border: 1px solid rgb(129 121 121 / 0.14);
    border-radius: var(--radius);
    background: linear-gradient(180deg, rgb(255 255 255 / 0.025), rgb(255 255 255 / 0.012));
    box-shadow: var(--shadow-panel);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.app-category-card:hover {
    border-color: rgb(237 201 158 / 0.18);
    box-shadow: 0 18px 38px rgb(0 0 0 / 0.24);
}

.app-category-card__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: var(--radius);
    background: hsl(var(--muted));
    color: hsl(var(--foreground));
}

.app-category-card:hover .app-category-card__icon {
    background: hsl(var(--foreground));
    color: hsl(var(--background));
}

.app-category-card__icon i {
    font-size: 0.875rem;
}

.app-category-card__title {
    margin: 0;
    color: hsl(var(--foreground));
    font-size: 1rem;
    font-weight: 800;
}

.app-category-card__copy {
    margin: 0;
    color: hsl(var(--muted-foreground));
    line-height: 1.65;
}

.app-empty-state {
    display: grid;
    gap: 0.75rem;
    place-items: center;
    padding: 2rem;
    border: 1px dashed rgb(129 121 121 / 0.22);
    border-radius: var(--radius);
    background: rgb(255 255 255 / 0.015);
    text-align: center;
}

.app-empty-state__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: var(--radius);
    background: hsl(var(--muted));
    color: hsl(var(--muted-foreground));
}

.app-empty-state__icon i {
    font-size: 1.25rem;
}

.app-empty-state__title {
    margin: 0;
    color: hsl(var(--foreground));
    font-size: 1.05rem;
    font-weight: 800;
}

.app-empty-state__copy {
    margin: 0;
    max-width: 34rem;
    color: hsl(var(--muted-foreground));
    line-height: 1.65;
}

.app-menu-popover {
    position: absolute;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(0.75rem) scale(0.98);
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
}

.app-menu-popover.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.app-menu-popover--top-right {
    right: 0;
    bottom: calc(100% + 0.75rem);
}

.app-menu-popover--bottom-right {
    right: 0;
    top: calc(100% + 0.75rem);
}

.app-menu-popover--soft {
    border: 1px solid rgb(129 121 121 / 0.1);
    border-radius: var(--radius);
    background: hsl(var(--card));
    box-shadow: 0 18px 48px rgb(0 0 0 / 0.28);
}

.app-card {
    border: 1px solid rgb(129 121 121 / 0.09);
    border-radius: var(--radius);
    background: linear-gradient(180deg, rgb(255 255 255 / 0.015), rgb(255 255 255 / 0.006));
    box-shadow: 0 1px 1px rgb(0 0 0 / 0.08);
}

.app-card--soft {
    background:
        linear-gradient(180deg, rgb(255 255 255 / 0.015), rgb(255 255 255 / 0.008)),
        rgb(255 255 255 / 0.005);
}

.app-card__body {
    padding: 1rem;
}

.app-card__title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: hsl(var(--foreground));
}

.app-product-title-marquee {
    position: relative;
    overflow: hidden;
}

.app-product-title-marquee__track {
    display: inline-flex;
    min-width: 100%;
    width: max-content;
    gap: 1.5rem;
    white-space: nowrap;
    animation: marqueeScroll 11s linear infinite;
}

.app-product-title-marquee:hover .app-product-title-marquee__track,
.app-product-title-marquee:focus-within .app-product-title-marquee__track {
    animation-play-state: paused;
}

.app-card__link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.875rem;
    color: rgb(237 201 158);
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
}

.app-card__link:hover {
    color: rgb(246 217 181);
}

.app-card__copy {
    margin: 0.6rem 0 0;
    color: hsl(var(--muted-foreground));
    line-height: 1.65;
}

.app-meta-list {
    display: grid;
    gap: 0.75rem;
    margin-top: 1rem;
}

.app-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    font-size: 0.9rem;
}

.app-meta-key {
    color: hsl(var(--muted-foreground));
}

.app-meta-value {
    color: hsl(var(--foreground));
    font-weight: 700;
    text-align: right;
}

.app-download-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.app-download-grid {
    display: grid;
    gap: 1rem;
}

.app-download-entry {
    padding: 1rem 1.25rem;
}

.app-download-entry + .app-download-entry {
    border-top: 1px solid hsl(var(--border));
}

.app-download-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.app-download-thumb {
    flex: none;
    width: 4rem;
    height: 4rem;
    overflow: hidden;
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    background: hsl(var(--muted));
}

.app-download-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.app-download-thumb-placeholder {
    display: flex;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    color: hsl(var(--muted-foreground));
}

.app-download-title {
    margin: 0;
    color: hsl(var(--foreground));
    font-size: 1rem;
    font-weight: 700;
}

.app-download-subtitle {
    margin: 0.25rem 0 0;
    color: hsl(var(--muted-foreground));
    font-size: 0.75rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.app-download-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    color: hsl(var(--muted-foreground));
    font-size: 0.78rem;
}

.app-download-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}

.app-list-item--split {
    align-items: center;
    justify-content: space-between;
}

.app-list-value {
    margin-left: auto;
    color: hsl(var(--foreground));
    font-weight: 700;
}

.app-list {
    display: grid;
    gap: 0.75rem;
}

.app-list-item {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    color: hsl(var(--muted-foreground));
    line-height: 1.6;
}

.app-list-item i {
    margin-top: 0.15rem;
    color: rgb(237 201 158);
    flex: none;
}

.app-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    justify-content: space-between;
}

.app-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 2.75rem;
    padding: 0.65rem 1rem;
    border-radius: var(--radius);
    border: 1px solid hsl(var(--border));
    font-size: 0.875rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    text-decoration: none;
    transform: translateY(0);
    transition:
        transform 0.18s cubic-bezier(0.23, 1, 0.32, 1),
        background-color 0.18s ease,
        border-color 0.18s ease,
        box-shadow 0.18s ease,
        color 0.18s ease,
        filter 0.18s ease;
}

.app-button--sm {
    min-height: 2.4rem;
    padding: 0.5rem 0.8rem;
    font-size: 0.8rem;
}

.app-button--field {
    width: 100%;
    justify-content: space-between;
    text-align: left;
}

.app-button--primary,
.portal-button-primary,
:is(button, a, input[type="submit"], input[type="button"]).bg-primary,
.button-primary {
    position: relative;
    overflow: hidden;
    border: 1px solid rgb(213 173 118 / 0.95);
    background:
        linear-gradient(180deg, rgb(242 213 162 / 0.98), rgb(210 170 111 / 0.98));
    color: hsl(var(--background));
    box-shadow:
        0 16px 30px rgb(0 0 0 / 0.24),
        0 2px 0 rgb(255 255 255 / 0.08) inset,
        inset 0 -1px 0 rgb(112 82 30 / 0.18),
        inset 0 1px 0 rgb(255 255 255 / 0.14);
}

.app-button--primary:hover,
.portal-button-primary:hover,
:is(button, a, input[type="submit"], input[type="button"]).bg-primary:hover,
.button-primary:hover {
    border-color: rgb(206 163 107 / 0.98);
    background:
        linear-gradient(180deg, rgb(246 219 175 / 0.99), rgb(216 178 118 / 0.99));
    box-shadow:
        0 18px 34px rgb(0 0 0 / 0.26),
        0 2px 0 rgb(255 255 255 / 0.12) inset,
        inset 0 -1px 0 rgb(112 82 30 / 0.14),
        inset 0 1px 0 rgb(255 255 255 / 0.16);
    filter: saturate(1.01);
}

.app-button--secondary,
.portal-button-secondary,
:is(button, a, input[type="button"], input[type="submit"]).border.border-border.bg-background,
.mini-button {
    border: 1px solid hsl(var(--border));
    background: linear-gradient(180deg, hsl(var(--background)), hsl(var(--card)));
    color: #fff;
    box-shadow:
        0 8px 18px rgb(0 0 0 / 0.12),
        inset 0 1px 0 rgb(255 255 255 / 0.04);
}

.app-button--secondary:hover,
.portal-button-secondary:hover,
:is(button, a, input[type="button"], input[type="submit"]).border.border-border.bg-background:hover,
.mini-button:hover {
    border-color: hsl(var(--primary) / 0.24);
    background: hsl(var(--accent));
    box-shadow:
        0 10px 20px rgb(0 0 0 / 0.14),
        inset 0 1px 0 rgb(255 255 255 / 0.04);
}

.app-button--ghost,
.portal-button-ghost {
    border-color: transparent;
    background: transparent;
    color: #fff;
}

.app-button--ghost:hover,
.portal-button-ghost:hover {
    background: rgb(255 255 255 / 0.04);
    color: #fff;
}

.app-button--danger,
.button-danger {
    border: 1px solid hsl(var(--destructive));
    background: hsl(var(--destructive));
    color: hsl(var(--background));
    box-shadow: 0 10px 22px rgb(0 0 0 / 0.18);
}

.app-button--danger:hover,
.button-danger:hover {
    border-color: hsl(var(--destructive));
    background: hsl(var(--destructive) / 0.92);
}

.app-button--link {
    min-height: auto;
    padding: 0;
    border: 0;
    background: transparent;
    color: hsl(var(--muted-foreground));
    text-decoration: underline;
    text-underline-offset: 0.2em;
}

.app-button--link:hover {
    color: hsl(var(--background));
    background: transparent;
}

.app-button--full {
    width: 100%;
}

.app-button[disabled] {
    cursor: not-allowed;
    opacity: 0.55;
    box-shadow: none;
    transform: none;
    filter: none;
}

.app-button:hover,
.portal-button-primary:hover,
.portal-button-secondary:hover,
.portal-button-ghost:hover,
.button-primary:hover,
.button-danger:hover,
.mini-button:hover,
button:hover:not([disabled]):not([type="checkbox"]):not([type="radio"]),
input[type="submit"]:hover:not([disabled]),
input[type="button"]:hover:not([disabled]) {
    transform: translateY(0);
}

.app-button:active,
.portal-button-primary:active,
.portal-button-secondary:active,
.portal-button-ghost:active,
.button-primary:active,
.button-danger:active,
.mini-button:active,
button:active:not([disabled]):not([type="checkbox"]):not([type="radio"]),
input[type="submit"]:active:not([disabled]),
input[type="button"]:active:not([disabled]) {
    transform: translateY(1px) scale(0.99);
}

.app-button:focus-visible,
.portal-button-primary:focus-visible,
.portal-button-secondary:focus-visible,
.portal-button-ghost:focus-visible,
.button-primary:focus-visible,
.button-danger:focus-visible,
.mini-button:focus-visible {
    box-shadow:
        0 0 0 3px hsl(var(--ring) / 0.16),
        0 10px 24px rgb(0 0 0 / 0.18);
}

.profile-tone {
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    background: linear-gradient(180deg, hsl(var(--card) / 0.96), hsl(var(--background) / 0.96));
    box-shadow: var(--shadow-soft);
}

.profile-tone--success {
    border-color: hsl(var(--success) / 0.28);
    background: linear-gradient(180deg, hsl(var(--success) / 0.12), hsl(var(--background) / 0.96));
}

.profile-tone--warning {
    border-color: hsl(var(--warning) / 0.28);
    background: linear-gradient(180deg, hsl(var(--warning) / 0.12), hsl(var(--background) / 0.96));
}

.profile-tone--danger {
    border-color: hsl(var(--destructive) / 0.28);
    background: linear-gradient(180deg, hsl(var(--destructive) / 0.12), hsl(var(--background) / 0.96));
}

.profile-tone--surface {
    border-color: hsl(var(--border));
    background: linear-gradient(180deg, hsl(var(--card) / 0.98), hsl(var(--background) / 0.96));
}

.profile-tone__title {
    color: hsl(var(--foreground));
    font-weight: 700;
}

.profile-tone__copy {
    color: hsl(var(--muted-foreground));
}

.app-input--code {
    min-height: 2.75rem;
    padding: 0.75rem 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-size: 0.875rem;
}

.cust-label {
    font-size: 0.875rem;
    font-weight: 600;
}

.cust-section-label {
    margin-bottom: 0.5rem;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: hsl(var(--muted-foreground));
}

.mode-seg,
.seg-row {
    display: grid;
    grid-auto-flow: column;
    gap: 0.375rem;
    padding: 0.3125rem;
    border: 1px solid hsl(var(--border));
    background: hsl(var(--muted) / 0.42);
    border-radius: calc(var(--radius-lg) + 0.125rem);
}

.mode-btn,
.seg-btn {
    min-height: 2.5rem;
    padding: 0.5rem 0.75rem;
    background: transparent;
    font-size: 0.875rem;
    font-weight: 600;
}

.mode-btn.active,
.seg-btn.active {
    background: linear-gradient(180deg, rgb(239 208 164 / 0.12), rgb(213 173 118 / 0.06));
    color: hsl(var(--foreground));
    border-color: hsl(var(--primary) / 0.22);
    box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.04);
}

.acc-select-wrap {
    position: relative;
}

.acc-select-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    width: 100%;
    min-height: 2.75rem;
    padding: 0.625rem 0.875rem;
}

.acc-select-name {
    min-width: 0;
    flex: 1 1 auto;
    text-align: left;
}

.acc-chevron {
    flex: none;
    font-size: 0.75rem;
    color: hsl(var(--muted-foreground));
    transition: transform 0.15s ease;
}

.acc-select-btn.open .acc-chevron {
    transform: rotate(180deg);
}

.acc-dropdown {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 0.5rem);
    z-index: 50;
    display: block;
    overflow: auto;
    border: 1px solid hsl(var(--border));
    background: hsl(var(--card));
    border-radius: calc(var(--radius-lg) + 0.25rem);
    box-shadow: var(--shadow-panel);
    padding: 0.375rem;
    opacity: 0;
    transform: translateY(0.5rem) scale(0.98);
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
}

.acc-dropdown.show {
    opacity: 1;
    transform: translateY(0) scale(1);
    visibility: visible;
    pointer-events: auto;
}

.acc-opt {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    width: 100%;
    min-height: 2.5rem;
    padding: 0.625rem 0.75rem;
    border-radius: calc(var(--radius) + 0.125rem);
    color: hsl(var(--foreground));
}

.acc-opt:hover,
.acc-opt.selected {
    background: hsl(var(--accent));
}

.acc-opt .check {
    color: hsl(var(--primary));
    opacity: 0;
    transition: opacity 0.15s ease;
}

.acc-opt.selected .check {
    opacity: 1;
}

/* Tailwind-style helpers for shared theme utilities */
.text-muted {
    color: hsl(var(--muted-foreground));
}

.text-primary {
    color: hsl(var(--primary));
}

.text-destructive {
    color: hsl(var(--destructive));
}

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

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

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

@media (max-width: 360px) {
    .cust-label {
        display: none;
    }

    .cust-panel {
        width: 100vw;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

.portal-toast-popup {
    border-radius: calc(var(--radius-lg) + 0.25rem) !important;
    background: hsl(var(--card)) !important;
    color: hsl(var(--foreground)) !important;
    border: 1px solid hsl(var(--border)) !important;
    box-shadow: var(--shadow-panel) !important;
}

/* Gallery System (WooCommerce-style) */
.gallery-nav {
    position: absolute;
    top: 50%;
    z-index: 10;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3.5rem;
    height: 3.5rem;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: none;
    border-radius: 0.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
    opacity: 0;
    font-size: 1.25rem;
    outline: none;
}

.gallery-nav:focus,
.gallery-nav:focus-visible {
    outline: none;
    box-shadow: none;
}

.group:hover .gallery-nav {
    opacity: 1;
}

.gallery-nav:hover {
    background: rgba(0, 0, 0, 0.7);
}

.gallery-nav:active {
    transform: translateY(-50%) scale(0.95);
}

.gallery-nav--prev {
    left: 1rem;
}

.gallery-nav--next {
    right: 1rem;
}

.gallery-strip-wrapper {
    position: relative;
    border: 1px solid hsl(var(--border));
    background: hsl(var(--card));
    border-radius: calc(var(--radius-lg) + 0.125rem);
    padding: 0.75rem;
}

.gallery-strip-nav {
    position: absolute;
    top: 50%;
    z-index: 10;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    transform: translateY(-50%);
    background: hsl(var(--card));
    color: hsl(var(--foreground));
    border: 1px solid hsl(var(--border));
    border-radius: 0.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875rem;
    outline: none;
}

.gallery-strip-nav:focus,
.gallery-strip-nav:focus-visible {
    outline: none;
    box-shadow: none;
}

.gallery-strip-nav:hover:not(:disabled) {
    background: hsl(var(--accent));
    border-color: hsl(var(--accent-foreground) / 0.2);
}

.gallery-strip-nav:active:not(:disabled) {
    transform: translateY(-50%) scale(0.92);
}

.gallery-strip-nav:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.gallery-strip-nav--prev {
    left: 0.5rem;
}

.gallery-strip-nav--next {
    right: 0.5rem;
}

.gallery-strip-viewport {
    overflow: hidden;
}

.gallery-strip {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding: 0 2.75rem 0.5rem 0;
    scrollbar-width: none;
}

.gallery-strip::-webkit-scrollbar {
    display: none;
}

.gallery-thumb {
    flex: 0 0 auto;
    width: 4.5rem;
    height: 4.5rem;
    padding: 0.5rem;
    background: hsl(var(--background));
    border: 2px solid transparent;
    border-radius: calc(var(--radius) + 0.125rem);
    cursor: pointer;
    transition: all 0.2s ease;
    overflow: hidden;
    outline: none;
}

.gallery-thumb:focus,
.gallery-thumb:focus-visible {
    outline: none;
    box-shadow: none;
}

.gallery-thumb:hover {
    border-color: hsl(var(--primary) / 0.6);
    background: hsl(var(--card));
}

.gallery-thumb.active {
    border-color: hsl(var(--primary));
    background: hsl(var(--primary) / 0.08);
}

.gallery-thumb__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: calc(var(--radius) - 0.125rem);
}

@media (min-width: 640px) {
    .gallery-thumb {
        width: 5rem;
        height: 5rem;
    }

    .gallery-strip {
        padding-right: 0.5rem;
    }
}

/* Lucide Icons Base Styling */
svg.lucide, [data-lucide] {
    display: inline-block;
    vertical-align: middle;
    width: 1.15em;
    height: 1.15em;
    stroke-width: 2;
    flex-shrink: 0;
}

i[data-lucide] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

svg.lucide.text-xs { width: 0.85rem; height: 0.85rem; }
svg.lucide.text-sm { width: 1rem; height: 1rem; }
svg.lucide.text-base { width: 1.125rem; height: 1.125rem; }
svg.lucide.text-lg { width: 1.25rem; height: 1.25rem; }
svg.lucide.text-xl { width: 1.5rem; height: 1.5rem; }
svg.lucide.text-2xl { width: 1.75rem; height: 1.75rem; }
svg.lucide.text-3xl { width: 2rem; height: 2rem; }
svg.lucide.text-4xl { width: 2.25rem; height: 2.25rem; }
svg.lucide.text-5xl { width: 3rem; height: 3rem; }
