.edit-page {
    --edit-ink: var(--account-ink, #26352e);
    --edit-muted: var(--account-muted, #65736b);
    --edit-line: var(--account-line, #dce5de);
    --edit-primary: var(--account-primary, #27634d);
    --edit-primary-hover: var(--account-primary-hover, #1f513f);
    width: 100%;
    min-width: 0;
    color: var(--edit-ink);
}

.edit-page h1 {
    color: var(--edit-ink);
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.edit-page h2,
.edit-page h3,
.edit-page h4 {
    overflow-wrap: anywhere;
}

.edit-page p {
    overflow-wrap: anywhere;
}

.edit-page .bg-white,
.edit-page .card {
    border-color: var(--edit-line) !important;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgb(38 53 46 / 6%);
}

.edit-page form label {
    color: #34453b;
    font-weight: 600;
}

.edit-page input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="hidden"]),
.edit-page select,
.edit-page textarea,
.edit-page .form-control {
    width: 100%;
    max-width: 100%;
    min-height: 44px;
    border: 1px solid #c7d4ca;
    border-radius: 6px;
    color: var(--edit-ink);
    background-color: #fff;
    font-size: 1rem;
}

.edit-page textarea {
    min-height: 112px;
    padding: 0.75rem;
    line-height: 1.5;
}

.edit-page input[type="file"] {
    min-height: 44px;
    max-width: 100%;
}

.edit-page input[type="color"] {
    min-height: 48px;
    max-width: 100%;
    border: 1px solid #c7d4ca;
    border-radius: 6px;
}

.edit-page input[type="checkbox"],
.edit-page input[type="radio"] {
    width: 18px;
    height: 18px;
    min-height: 18px;
    flex: 0 0 auto;
    accent-color: var(--edit-primary);
}

.edit-page :is(input, select, textarea, button, a):focus-visible {
    outline: 3px solid rgb(39 99 77 / 24%);
    outline-offset: 2px;
}

.edit-page button,
.edit-page [role="button"],
.edit-page form a[class*="bg-"],
.edit-page .btn {
    min-height: 44px;
}

.edit-page .text-gray-500,
.edit-page .text-gray-600,
.edit-page .text-muted {
    color: var(--edit-muted) !important;
}

.edit-page .text-red-500,
.edit-page .text-red-600 {
    color: #a43f3f !important;
}

.edit-page .nav-tabs {
    flex-wrap: nowrap;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
}

.edit-page .nav-tabs .nav-item {
    flex: 0 0 auto;
}

.edit-page.container-fluid {
    width: 100%;
    padding-right: 0;
    padding-left: 0;
}

.edit-page .row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -0.75rem;
    margin-left: -0.75rem;
}

.edit-page .row>[class*="col-"] {
    width: 100%;
    min-width: 0;
    padding-right: 0.75rem;
    padding-left: 0.75rem;
}

.edit-page .card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #fff;
}

.edit-page .card-primary.card-outline {
    border-top: 3px solid var(--edit-primary);
}

.edit-page .card-header,
.edit-page .card-body {
    padding: 1rem 1.25rem;
}

.edit-page .card-header {
    justify-content: space-between;
    border-bottom: 1px solid var(--edit-line);
    background: #fff;
}

.edit-page .card-title {
    margin: 0;
    color: var(--edit-ink);
    font-size: 1.125rem;
    font-weight: 700;
}

.edit-page .card-tools {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.edit-page .tab-content {
    padding: 1.25rem;
    border: 1px solid var(--edit-line);
    border-top: 0;
    background: #fff;
}

.edit-page .tab-pane {
    display: none;
}

.edit-page .tab-pane.active {
    display: block;
}

.edit-page .nav-tabs .nav-link {
    display: block;
    padding: 0.75rem 1rem;
    border: 1px solid transparent;
    border-radius: 6px 6px 0 0;
    color: var(--edit-muted);
    text-decoration: none;
    white-space: nowrap;
}

.edit-page .nav-tabs .nav-link.active {
    border-color: var(--edit-line) var(--edit-line) #fff;
    color: var(--edit-primary);
    font-weight: 700;
}

.edit-page .form-group {
    margin-bottom: 1rem;
}

.edit-page .input-group {
    display: flex;
    align-items: stretch;
    gap: 0.5rem;
    min-width: 0;
}

.edit-page .input-group .form-control {
    flex: 1 1 auto;
    min-width: 0;
}

.edit-page .input-group-append {
    display: flex;
    flex: 0 0 auto;
}

.edit-page .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.55rem 0.9rem;
    border: 1px solid transparent;
    border-radius: 6px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

.edit-page .btn-primary,
.edit-page .btn-success {
    color: #fff;
    background: var(--edit-primary);
}

.edit-page .btn-info {
    color: #fff;
    background: #397d83;
}

.edit-page .btn-warning {
    color: #47330d;
    background: #f0d28e;
}

.edit-page .btn-danger,
.edit-page .btn-outline-danger:hover {
    color: #fff;
    background: #a74646;
}

.edit-page .btn-outline-danger {
    border-color: #a74646;
    color: #a74646;
    background: #fff;
}

.edit-page .text-primary {
    color: var(--edit-primary) !important;
}

.edit-page .badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
}

.edit-page .badge-success {
    color: #20533e;
    background: #e2f1e8;
}

.edit-page .badge-secondary {
    color: #4e5b53;
    background: #e9eeea;
}

.edit-page .table {
    width: 100%;
    border-collapse: collapse;
}

.edit-page .table th,
.edit-page .table td {
    padding: 0.65rem;
    border: 1px solid var(--edit-line);
    text-align: left;
    vertical-align: top;
}

.edit-page .table th {
    background: #f2f6f3;
}

.theme-select-page {
    padding-bottom: 2rem;
    background: #f4f6f3;
}

.theme-select-page .catalog-hero {
    padding-top: 1.5rem !important;
    padding-bottom: 1.5rem !important;
    border-bottom: 1px solid var(--edit-line);
    background: #e9f0ea !important;
    animation: none !important;
}

.theme-select-page .catalog-hero>.absolute {
    display: none !important;
}

.theme-select-page .catalog-hero .text-center {
    color: var(--edit-ink) !important;
    text-align: left;
}

.theme-select-page .catalog-hero .text-center>.inline-flex {
    border: 1px solid var(--edit-line);
    color: var(--edit-primary) !important;
    background: #fff !important;
    backdrop-filter: none;
}

.theme-select-page .catalog-hero h1 {
    margin-bottom: 0.5rem;
    color: var(--edit-ink) !important;
    font-size: 1.75rem;
    line-height: 1.25;
}

.theme-select-page .catalog-hero h1 span {
    color: var(--edit-primary) !important;
    background: none !important;
    -webkit-text-fill-color: var(--edit-primary) !important;
}

.theme-select-page .catalog-hero p,
.theme-select-page .catalog-hero nav,
.theme-select-page .catalog-hero nav a,
.theme-select-page .catalog-hero nav span {
    color: var(--edit-muted) !important;
}

.theme-select-page .catalog-hero p {
    margin-bottom: 0;
    font-size: 1rem;
}

.theme-select-page .catalog-hero .max-w-md {
    display: none;
}

.theme-select-page>.max-w-7xl.-mt-8 {
    margin-top: 1.25rem !important;
}

.theme-select-page .filter-section {
    border: 1px solid var(--edit-line);
    border-radius: 8px;
    box-shadow: 0 4px 16px rgb(38 53 46 / 6%);
}

.theme-select-page .filter-section input:focus,
.theme-select-page .filter-section select:focus {
    border-color: var(--edit-primary) !important;
    --tw-ring-color: rgb(39 99 77 / 20%);
}

.theme-select-page #sortSelect {
    width: auto;
    min-width: 140px;
}

.theme-select-page .filter-btn,
.theme-select-page .category-filter {
    min-height: 44px;
    border: 1px solid var(--edit-line);
    border-radius: 6px;
    background: #f1f5f2 !important;
    color: #425349 !important;
}

.theme-select-page .filter-btn.active,
.theme-select-page .category-filter.active {
    border-color: var(--edit-primary) !important;
    background: var(--edit-primary) !important;
    color: #fff !important;
    box-shadow: none;
    transform: none;
}

.theme-select-page .template-card>.bg-white {
    height: 100%;
    border: 1px solid var(--edit-line);
    border-radius: 8px;
    box-shadow: 0 4px 16px rgb(38 53 46 / 6%);
}

.theme-select-page .template-card .quick-select,
.theme-select-page #emptyState button {
    border-radius: 6px;
    background: var(--edit-primary) !important;
    color: #fff !important;
}

.theme-select-page .template-card .quick-select:hover,
.theme-select-page #emptyState button:hover {
    background: var(--edit-primary-hover) !important;
}

.theme-select-page .template-card .badge-enterprise {
    background: #397d83 !important;
}

.theme-select-page #resultsInfo .text-purple-600 {
    color: var(--edit-primary) !important;
}

.theme-select-page #gridView.active,
.theme-select-page #listView.active {
    color: var(--edit-primary) !important;
    background: #e9f0ea !important;
}

.theme-select-page #quickSelectModal>div {
    border-radius: 8px;
}

@media (min-width: 768px) {
    .edit-page .row>.col-md-6 {
        width: 50%;
    }

    .edit-page .row>.col-md-12 {
        width: 100%;
    }
}

.edit-page .table-responsive {
    max-width: 100%;
    overscroll-behavior-x: contain;
}

@media (max-width: 640px) {
    .edit-page h1 {
        font-size: 1.5rem;
    }

    .edit-page .p-6 {
        padding: 1rem !important;
    }

    .edit-page .px-6 {
        padding-right: 1rem !important;
        padding-left: 1rem !important;
    }

    .edit-page .grid-cols-2,
    .edit-page .grid-cols-3,
    .edit-page .grid-cols-4 {
        grid-template-columns: minmax(0, 1fr);
    }

    .edit-page .flex.justify-end,
    .edit-page form [class*="justify-end"] {
        align-items: stretch;
        flex-direction: column;
    }

    .edit-page .flex.justify-end>*,
    .edit-page form [class*="justify-end"]>* {
        width: 100%;
        justify-content: center;
        text-align: center;
    }

    .edit-page .card-tools {
        position: static;
        float: none;
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
        margin-top: 0.75rem;
    }

    .edit-page .card-header {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 0.5rem;
    }

    .edit-page .row {
        margin-right: -0.5rem;
        margin-left: -0.5rem;
    }

    .edit-page .row>[class*="col-"] {
        padding-right: 0.5rem;
        padding-left: 0.5rem;
    }

    .edit-page .card-header,
    .edit-page .card-body,
    .edit-page .tab-content {
        padding: 1rem;
    }

    .edit-page .input-group {
        flex-wrap: wrap;
    }

    .edit-page .input-group .form-control {
        flex-basis: 100%;
    }

    .edit-page .input-group-append {
        width: 100%;
    }

    .edit-page .input-group-append .btn {
        width: 100%;
    }

    .theme-select-page .catalog-hero {
        padding-top: 1.25rem !important;
        padding-bottom: 1.25rem !important;
    }

    .theme-select-page .catalog-hero h1 {
        font-size: 1.5rem;
    }

    .theme-select-page .filter-section>.flex {
        align-items: stretch;
    }

    .theme-select-page .filter-section>.flex>.flex:last-child {
        justify-content: space-between;
    }

    .theme-select-page #sortSelect {
        flex: 1;
    }

    .theme-select-page #templateGrid.grid-cols-1 .template-card>div {
        flex-direction: column;
    }

    .theme-select-page #templateGrid.grid-cols-1 .template-thumbnail {
        width: 100%;
    }

    .theme-select-page .template-card .template-info {
        padding: 1rem;
    }

    .theme-select-page #resultsInfo {
        min-width: 0;
        font-size: 0.875rem;
    }
}

@media (prefers-reduced-motion: reduce) {

    .edit-page *,
    .edit-page *::before,
    .edit-page *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}

.theme-select-page {
    background: var(--account-canvas, #f4f6f3);
}

.theme-select-page .catalog-hero {
    background: #edf2ee !important;
}

.theme-select-page .filter-section,
.theme-select-page .template-card > div,
.theme-select-page #quickSelectModal > div {
    border-color: var(--account-line, #dfe6e0) !important;
    background-color: var(--account-surface, #fff);
}

.theme-select-page .filter-btn.active,
.theme-select-page .category-filter.active,
.theme-select-page .template-card .quick-select,
.theme-select-page #emptyState button,
.theme-select-page #backToTop,
.theme-select-page #quickSelectForm button[type="submit"] {
    background: var(--account-primary, #27634d) !important;
    color: #fff !important;
}

.theme-select-page .filter-btn.active:hover,
.theme-select-page .template-card .quick-select:hover,
.theme-select-page #emptyState button:hover,
.theme-select-page #quickSelectForm button[type="submit"]:hover {
    background: var(--account-primary-hover, #1f513f) !important;
}

.theme-select-page .template-info form button {
    border-color: var(--account-line, #dfe6e0) !important;
    color: var(--account-primary, #27634d) !important;
    background: #edf2ee !important;
}

.theme-select-page .active-filter-tag {
    color: var(--account-primary, #27634d);
    background: #edf2ee;
}

.theme-select-page .template-card > div {
    transition: box-shadow .25s ease, transform .25s ease;
}

.theme-select-page .template-card > div:hover {
    box-shadow: 0 14px 34px rgb(36 52 45 / 12%);
}

.theme-select-page #quickSelectModal > div {
    border: 1px solid var(--account-line, #dfe6e0);
    border-radius: 14px;
}

.theme-select-page > .max-w-7xl.-mt-8 .bg-gradient-to-r {
    border-color: var(--account-line, #dfe6e0) !important;
    background: #edf2ee !important;
}

.theme-select-page > .max-w-7xl.-mt-8 .bg-green-500,
.theme-select-page #quickSelectModal .bg-gradient-to-r {
    background: var(--account-primary, #27634d) !important;
}

.theme-select-page > .max-w-7xl.-mt-8 .text-green-600,
.theme-select-page > .max-w-7xl.-mt-8 .text-green-700 {
    color: var(--account-primary, #27634d) !important;
}

@media (max-width: 640px) {
    .theme-select-page .catalog-hero {
        background: var(--account-canvas, #f4f6f3) !important;
    }

    .theme-select-page #resultsInfo {
        max-width: calc(100% - 96px);
    }

    .theme-select-page .template-card .template-info form button,
    .theme-select-page .template-card .template-info [class~="md:hidden"] button {
        border-radius: 8px;
    }
}