.qm-article-type-switcher {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 18px;
    border: 1px solid var(--qm-border-gray-200, #e5e7eb);
    border-radius: 14px;
    background: var(--qm-bg-white, #ffffff);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.05);
}

.qm-article-type-switcher__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.qm-article-type-switcher__eyebrow {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
    color: var(--qm-text-light, #9ca3af);
}

.qm-article-type-switcher__desc {
    margin: 4px 0 0;
    font-size: 15px;
    line-height: 1.55;
    color: var(--qm-text-secondary, #4b5563);
}

.qm-article-type-switcher__tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.qm-article-type-switcher__tab {
    min-width: 108px;
    height: 40px;
    padding: 0 16px;
    border: 1px solid var(--qm-border-gray-200, #e5e7eb);
    border-radius: 999px;
    background: var(--qm-bg-gray-50, #f9fafb);
    color: var(--qm-text-secondary, #4b5563);
    font-size: 15px;
    line-height: 1;
    transition: background-color var(--qm-transition-fast, 0.2s ease), border-color var(--qm-transition-fast, 0.2s ease), color var(--qm-transition-fast, 0.2s ease), transform var(--qm-transition-fast, 0.2s ease);
}

.qm-article-type-switcher__tab:hover {
    border-color: var(--qm-primary-rgba-20, rgba(217, 38, 29, 0.2));
    color: var(--qm-primary, #d9261d);
    transform: translateY(-1px);
}

.qm-article-type-switcher__tab.is-active {
    border-color: var(--qm-primary, #d9261d);
    background: var(--qm-primary-rgba-08, rgba(217, 38, 29, 0.08));
    color: var(--qm-primary, #d9261d);
}

.qm-article-type-switcher--modal {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    position: relative;
}

.qm-article-type-switcher__trigger {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 40px;
    padding: 6px 14px 6px 16px;
    border: 1px solid var(--qm-border-gray-200, #e5e7eb);
    border-radius: 999px;
    background: var(--qm-bg-white, #ffffff);
    color: var(--qm-text-primary, #111827);
    font-size: 15px;
    line-height: 1;
    transition: border-color var(--qm-transition-fast, 0.2s ease), color var(--qm-transition-fast, 0.2s ease), transform var(--qm-transition-fast, 0.2s ease);
}

.qm-article-type-switcher__trigger:hover {
    border-color: var(--qm-primary-rgba-20, rgba(217, 38, 29, 0.2));
    color: var(--qm-primary, #d9261d);
    transform: translateY(-1px);
}

.qm-article-type-switcher__trigger:focus-visible,
.qm-article-type-modal__close:focus-visible,
.qm-article-type-preview-card:focus-visible {
    outline: none;
    border-color: var(--qm-primary, #d9261d);
    box-shadow: 0 0 0 3px var(--qm-primary-rgba-08, rgba(217, 38, 29, 0.08));
}

.qm-article-type-switcher__trigger-label {
    color: var(--qm-text-light, #9ca3af);
}

.qm-article-type-switcher__trigger-value {
    color: inherit;
}

.qm-article-type-switcher__trigger-caret {
    width: 16px;
    height: 16px;
    color: currentColor;
}

.qm-article-type-switcher__trigger-caret svg {
    display: block;
    width: 100%;
    height: 100%;
}

body.qm-article-type-modal-open {
    overflow: hidden;
}

.qm-article-type-modal {
    position: fixed;
    inset: 0;
    z-index: 10010;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 20px;
}

.qm-article-type-modal__backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    background: rgba(15, 23, 42, 0.46);
}

.qm-article-type-modal__dialog {
    position: relative;
    width: min(100%, 1040px);
    max-height: calc(100vh - 64px);
    max-height: calc(100dvh - 64px);
    padding: 24px;
    border: 1px solid var(--qm-border-gray-200, #e5e7eb);
    border-radius: 14px;
    background: var(--qm-bg-white, #ffffff);
    box-shadow: 0 22px 54px rgba(15, 23, 42, 0.16);
    overflow-y: auto;
}

.qm-article-type-modal__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}

.qm-article-type-modal__title {
    margin: 0;
    font-size: 18px;
    line-height: 1.4;
    font-weight: 500;
    color: var(--qm-text-primary, #111827);
}

.qm-article-type-modal__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid var(--qm-border-gray-200, #e5e7eb);
    border-radius: 999px;
    background: var(--qm-bg-white, #ffffff);
    color: var(--qm-text-secondary, #4b5563);
    font-size: 20px;
    line-height: 1;
    transition: border-color var(--qm-transition-fast, 0.2s ease), color var(--qm-transition-fast, 0.2s ease);
}

.qm-article-type-modal__close:hover {
    border-color: var(--qm-primary-rgba-20, rgba(217, 38, 29, 0.2));
    color: var(--qm-primary, #d9261d);
}

.qm-article-type-modal__grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.qm-article-type-preview-card {
    --qm-type-preview-border: rgba(148, 163, 184, 0.24);
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
    padding: 14px;
    border: 1px solid var(--qm-border-gray-200, #e5e7eb);
    border-radius: 14px;
    background: var(--qm-bg-white, #ffffff);
    text-align: left;
    transition: border-color var(--qm-transition-fast, 0.2s ease), box-shadow var(--qm-transition-fast, 0.2s ease), transform var(--qm-transition-fast, 0.2s ease);
}

.qm-article-type-preview-card:hover {
    border-color: var(--qm-primary-rgba-20, rgba(217, 38, 29, 0.2));
    transform: translateY(-1px);
}

.qm-article-type-preview-card.is-active {
    --qm-type-preview-border: var(--qm-type-preview-accent);
    border-color: var(--qm-type-preview-accent);
    box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.04);
}

.qm-article-type-preview-card__media {
    display: block;
}

.qm-article-type-preview-card__svg {
    display: block;
    width: 100%;
    height: auto;
}

.qm-article-type-preview-card__name {
    display: block;
    text-align: center;
    font-size: 15px;
    line-height: 1.55;
    font-weight: 400;
    color: var(--qm-text-secondary, #4b5563);
}

.dark .qm-article-type-switcher__trigger,
.dark .qm-article-type-modal__close,
.dark .qm-article-type-preview-card {
    border-color: var(--qm-border-dark-600);
    background: var(--qm-bg-dark-700);
}

.dark .qm-article-type-switcher__trigger,
.dark .qm-article-type-modal__title,
.dark .qm-article-type-preview-card__name {
    color: var(--qm-text-secondary);
}

.dark .qm-article-type-switcher__trigger-label {
    color: var(--qm-text-muted);
}

.dark .qm-article-type-modal__dialog {
    border-color: var(--qm-border-dark-600);
    background: var(--qm-bg-dark-800);
}

.qm-article-type-pages {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.qm-type-editor-page {
    display: none;
}

.qm-type-editor-page.is-active {
    display: block;
}

.qm-type-editor-page--material {
    margin-top: 0;
}

.qm-type-editor-page--material .qm-material-upload-panel + .qm-type-editor-card {
    margin-top: 16px;
}

.qm-type-editor-page .qm-type-editor-card + .qm-type-editor-card {
    margin-top: 16px;
}

.qm-material-upload-panel {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    padding: 18px;
    border: 1px solid var(--qm-border-gray-200, #e5e7eb);
    border-radius: 14px;
    background: var(--qm-bg-white, #ffffff);
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.04);
}

.qm-material-gallery__grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
}

.qm-material-gallery.is-empty .qm-material-gallery__grid {
    grid-template-columns: minmax(0, 1fr);
}

.qm-material-gallery__item,
.qm-material-gallery__adder {
    position: relative;
    width: 100%;
}

.qm-material-gallery.is-empty .qm-material-gallery__adder {
    grid-column: 1 / -1;
}

.qm-material-gallery__item-surface,
.qm-material-gallery__add-card {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    aspect-ratio: 1 / 1;
    border: 2px dashed rgba(148, 163, 184, 0.34);
    border-radius: 12px;
    background: var(--qm-bg-gray-50, #f8fafc);
    overflow: hidden;
    transition: border-color var(--qm-transition-fast, 0.2s ease),
        background-color var(--qm-transition-fast, 0.2s ease),
        transform var(--qm-transition-fast, 0.2s ease),
        opacity var(--qm-transition-fast, 0.2s ease);
}

.qm-material-gallery__item-surface {
    border-style: solid;
    border-width: 1px;
    border-color: rgba(148, 163, 184, 0.18);
    background: #f8fafc;
}

.qm-material-gallery__add-card {
    padding: 0;
    cursor: pointer;
}

.qm-material-gallery.is-empty .qm-material-gallery__add-card {
    min-height: 240px;
    aspect-ratio: auto;
}

.qm-material-gallery__add-card:hover,
.qm-material-gallery__add-card:focus-visible {
    border-color: var(--qm-primary-rgba-35, rgba(217, 38, 29, 0.35));
    background: var(--qm-primary-rgba-04, rgba(217, 38, 29, 0.04));
    outline: none;
}

.qm-material-gallery__item:hover .qm-material-gallery__item-surface {
    transform: translateY(-1px);
}

.qm-material-gallery__item-preview {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.qm-material-gallery__add-plus {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    color: var(--qm-primary, #d9261d);
}

.qm-material-gallery__add-plus svg,
.qm-material-gallery__remove svg {
    display: block;
    width: 22px;
    height: 22px;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
}

.qm-material-gallery__remove {
    position: absolute;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    color: #475569;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
    transition: opacity var(--qm-transition-fast, 0.2s ease),
        transform var(--qm-transition-fast, 0.2s ease),
        background-color var(--qm-transition-fast, 0.2s ease),
        color var(--qm-transition-fast, 0.2s ease);
}

.qm-material-gallery__remove {
    right: 8px;
    top: 8px;
    opacity: 0;
    transform: translateY(-4px);
    color: #ef4444;
}

.qm-material-gallery__item:hover .qm-material-gallery__remove,
.qm-material-gallery__item:focus-within .qm-material-gallery__remove {
    opacity: 1;
    transform: translateY(0);
}

.qm-material-gallery__remove:hover,
.qm-material-gallery__remove:focus-visible {
    background: rgba(255, 255, 255, 0.96);
    color: #dc2626;
    outline: none;
}

.qm-material-gallery.is-uploading .qm-material-gallery__add-card {
    pointer-events: none;
    opacity: 0.5;
}

.qm-material-upload-panel__hint {
    margin: 0;
    text-align: center;
    font-size: 13px;
    line-height: 1.5;
    color: var(--qm-text-light, #9ca3af);
}

.dark .qm-material-upload-panel {
    border-color: var(--qm-border-dark-600);
    background: var(--qm-bg-dark-800);
}

.dark .qm-material-gallery__item-surface,
.dark .qm-material-gallery__add-card {
    border-color: rgba(148, 163, 184, 0.3);
    background: var(--qm-bg-dark-700);
}

.dark .qm-material-gallery__add-card:hover,
.dark .qm-material-gallery__add-card:focus-visible,
.dark .qm-material-gallery__remove:hover,
.dark .qm-material-gallery__remove:focus-visible {
    background: rgba(236, 72, 153, 0.08);
}

.dark .qm-material-gallery__remove {
    background: rgba(15, 23, 42, 0.82);
    color: var(--qm-text-secondary);
}

.dark .qm-material-gallery__remove {
    color: #fda4af;
}

.dark .qm-material-upload-panel__hint {
    color: var(--qm-text-muted);
}

.qm-type-editor-hidden-fields {
    display: none !important;
}

.qm-type-editor-card {
    padding: 18px;
    border: 1px solid var(--qm-border-gray-200, #e5e7eb);
    border-radius: 14px;
    background: var(--qm-bg-white, #ffffff);
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.04);
}

.qm-type-editor-card--hint {
    padding: 22px;
}

.qm-type-editor-card__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.qm-type-editor-page__intro {
    margin-bottom: 16px;
}

.qm-type-editor-page__title,
.qm-type-editor-card__title {
    margin: 0;
    font-size: 18px;
    font-weight: 500;
    line-height: 1.4;
    color: var(--qm-text-primary, #111827);
}

.qm-type-editor-page__desc,
.qm-type-editor-card__desc {
    margin: 6px 0 0;
    font-size: 15px;
    line-height: 1.55;
    color: var(--qm-text-secondary, #4b5563);
}

.qm-type-editor-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.qm-type-editor-grid--wide {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.qm-type-editor-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.qm-type-editor-field--media-wide {
    grid-column: 1 / -1;
}

.qm-type-editor-field__label {
    font-size: 15px;
    line-height: 1.5;
    color: var(--qm-text-primary, #111827);
}

.qm-type-editor-field__input {
    width: 100%;
    min-height: 44px;
    padding: 11px 14px;
    border: 1px solid var(--qm-border-gray-200, #e5e7eb);
    border-radius: 10px;
    background: var(--qm-bg-white, #ffffff);
    color: var(--qm-text-primary, #111827);
    font-size: 15px;
    line-height: 1.55;
    transition: border-color var(--qm-transition-fast, 0.2s ease), box-shadow var(--qm-transition-fast, 0.2s ease);
}

.qm-type-editor-field__input:focus {
    outline: none;
    border-color: var(--qm-primary-rgba-35, rgba(217, 38, 29, 0.35));
    box-shadow: 0 0 0 3px var(--qm-primary-rgba-08, rgba(217, 38, 29, 0.08));
}

.qm-type-editor-field textarea.qm-type-editor-field__input {
    min-height: 112px;
    resize: vertical;
}

.qm-type-editor-field__hint {
    font-size: 13px;
    line-height: 1.5;
    color: var(--qm-text-light, #9ca3af);
}

.qm-type-editor-palette-input {
    display: flex;
    align-items: center;
    gap: 10px;
}

.qm-type-editor-palette-input__swatch {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    min-width: 44px;
    height: 44px;
    padding: 4px;
    border: 1px solid var(--qm-border-gray-200, #e5e7eb);
    border-radius: 10px;
    background: var(--qm-bg-gray-50, #f9fafb);
    overflow: hidden;
    cursor: pointer;
}

.qm-type-editor-palette-input__picker {
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.qm-type-editor-palette-input__picker::-webkit-color-swatch-wrapper {
    padding: 0;
}

.qm-type-editor-palette-input__picker::-webkit-color-swatch,
.qm-type-editor-palette-input__picker::-moz-color-swatch {
    border: 0;
    border-radius: 8px;
}

.qm-type-editor-palette-input .qm-type-editor-field__input {
    flex: 1 1 auto;
}

.qm-type-editor-palette-input.is-empty .qm-type-editor-palette-input__swatch {
    border-style: dashed;
    opacity: 0.72;
}

.qm-type-editor-media {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.qm-type-editor-media__preview {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 180px;
    border: 1px dashed var(--qm-border-gray-300, #d1d5db);
    border-radius: 12px;
    background: var(--qm-bg-gray-50, #f9fafb);
    overflow: hidden;
}

.qm-type-editor-media__preview img {
    width: 100%;
    height: 100%;
    max-height: 260px;
    object-fit: cover;
}

.qm-type-editor-media__placeholder {
    padding: 16px;
    font-size: 13px;
    line-height: 1.5;
    color: var(--qm-text-light, #9ca3af);
    text-align: center;
}

.qm-type-editor-media__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.qm-type-editor-btn,
.qm-type-editor-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0 14px;
    border: 1px solid var(--qm-border-gray-200, #e5e7eb);
    border-radius: 10px;
    background: var(--qm-bg-white, #ffffff);
    color: var(--qm-text-secondary, #4b5563);
    font-size: 14px;
    line-height: 1;
    transition: border-color var(--qm-transition-fast, 0.2s ease), color var(--qm-transition-fast, 0.2s ease), background-color var(--qm-transition-fast, 0.2s ease), transform var(--qm-transition-fast, 0.2s ease);
}

.qm-type-editor-btn:hover,
.qm-type-editor-icon-btn:hover {
    border-color: var(--qm-primary-rgba-20, rgba(217, 38, 29, 0.2));
    color: var(--qm-primary, #d9261d);
    transform: translateY(-1px);
}

.qm-type-editor-btn.is-subtle {
    background: var(--qm-bg-gray-50, #f9fafb);
}

.qm-type-editor-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
    gap: 14px;
    align-items: start;
    padding: 16px 0;
    border-top: 1px solid var(--qm-border-gray-200, #e5e7eb);
}

.qm-type-editor-row:first-child {
    padding-top: 0;
    border-top: 0;
}

.qm-type-editor-row--media,
.qm-type-editor-row--compact {
    grid-template-columns: minmax(0, 1fr) auto;
}

.qm-type-editor-row--media .qm-type-editor-media {
    width: 100%;
}

.qm-type-editor-row--compact .qm-type-editor-field {
    grid-template-columns: none;
}

.qm-type-editor-card--sidebar {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.qm-type-editor-card--sidebar .qm-type-editor-card__head {
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.qm-type-editor-card--sidebar .qm-type-editor-card__title,
.qm-type-editor-card--sidebar .qm-type-editor-card__desc {
    display: none;
}

.qm-type-editor-card--sidebar .qm-type-editor-card__body {
    display: grid;
    gap: 0;
}

.qm-type-editor-card--sidebar .qm-type-editor-btn {
    min-height: 32px;
    padding: 0 12px;
    border-radius: 999px;
    font-size: 12px;
}

.qm-type-editor-card--sidebar .qm-type-editor-row {
    gap: 8px;
    padding: 8px 0;
    border-top-color: rgba(148, 163, 184, 0.14);
    grid-template-columns: minmax(0, 1fr);
}

.qm-type-editor-card--sidebar .qm-type-editor-field {
    gap: 5px;
}

.qm-type-editor-card--sidebar .qm-type-editor-field__label {
    font-size: 12px;
    line-height: 1.5;
    color: var(--qm-text-secondary, #4b5563);
}

.qm-type-editor-card--sidebar .qm-type-editor-field__input {
    min-height: 34px;
    padding: 7px 10px;
    border-radius: 8px;
    font-size: 12px;
    box-shadow: none;
}

.qm-type-editor-card--sidebar .qm-type-editor-icon-btn {
    min-height: 30px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 12px;
}

.qm-type-editor-card--sidebar textarea.qm-type-editor-field__input {
    min-height: 70px;
}

.qm-type-editor-card--sidebar .qm-type-editor-row__toolbar {
    gap: 8px;
    align-items: start;
}

.qm-type-editor-card--sidebar .qm-type-editor-row__toolbar--feature {
    grid-template-columns: 58px minmax(0, 1fr) auto;
}

.qm-type-editor-card--sidebar .qm-type-editor-row__toolbar--changelog {
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.86fr) auto;
}

.qm-type-editor-card--sidebar .qm-type-editor-row__toolbar--install {
    grid-template-columns: 58px minmax(0, 1fr) auto;
}

.qm-type-editor-card--sidebar .qm-type-editor-row__toolbar--faq {
    grid-template-columns: minmax(0, 1fr) auto;
}

.qm-type-editor-card--sidebar .qm-type-editor-icon-btn--tool {
    width: 30px;
    min-width: 30px;
    min-height: 30px;
    height: 30px;
}

.qm-type-editor-card--sidebar .qm-type-editor-icon-btn--tool svg {
    width: 14px;
    height: 14px;
}

.qm-type-editor-card--sidebar .qm-type-editor-icon-btn--tool.is-danger {
    width: 18px;
    min-width: 18px;
    min-height: 18px;
    height: 18px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    align-self: start;
}

.qm-type-editor-card--sidebar .qm-type-editor-icon-btn--tool.is-danger svg {
    width: 16px;
    height: 16px;
}

.qm-type-editor-install-upload {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    min-width: 64px;
    height: 60px;
    padding: 0;
    border: 1px dashed rgba(59, 130, 246, 0.34);
    border-radius: 10px;
    background: transparent;
    color: #3b82f6;
    cursor: pointer;
    overflow: hidden;
    transition: border-color var(--qm-transition-fast, 0.2s ease), background-color var(--qm-transition-fast, 0.2s ease), color var(--qm-transition-fast, 0.2s ease);
}

.qm-type-editor-install-upload:hover,
.qm-type-editor-install-upload:focus-visible {
    border-color: rgba(59, 130, 246, 0.56);
    background: rgba(59, 130, 246, 0.04);
    outline: none;
}

.qm-type-editor-install-upload.is-active {
    border-style: solid;
    border-color: rgba(59, 130, 246, 0.22);
}

.qm-type-editor-install-upload__placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.qm-type-editor-install-upload__placeholder svg {
    display: block;
    width: 18px;
    height: 18px;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
}

.qm-type-editor-install-upload__preview {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.qm-type-editor-install-upload--feature {
    width: 54px;
    min-width: 54px;
    height: 54px;
    border-radius: 10px;
}

.qm-type-editor-row__toolbar {
    display: grid;
    gap: 10px;
    align-items: end;
}

.qm-type-editor-row__toolbar--feature {
    grid-template-columns: 54px minmax(0, 1fr) auto;
}

.qm-type-editor-row__toolbar--changelog {
    grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
}

.qm-type-editor-row__toolbar--install {
    grid-template-columns: 64px minmax(0, 1fr) auto;
}

.qm-type-editor-row__footer-actions {
    display: flex;
    justify-content: flex-end;
}

.qm-type-editor-icon-btn--tool {
    width: 34px;
    min-width: 34px;
    min-height: 34px;
    height: 34px;
    padding: 0;
    border-radius: 999px;
}

.qm-type-editor-icon-btn--tool svg {
    display: block;
    width: 16px;
    height: 16px;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
}

.qm-type-editor-icon-btn--tool.is-danger {
    color: #ef4444;
    border-color: transparent;
    background: transparent;
    box-shadow: none;
}

.qm-type-editor-icon-btn--tool.is-danger:hover,
.qm-type-editor-icon-btn--tool.is-danger:focus-visible {
    border-color: transparent;
    background: transparent;
    color: #dc2626;
    transform: none;
}

.qm-type-editor-icon-btn--tool.is-upload {
    color: #3b82f6;
}

.qm-type-editor-icon-btn--tool.is-upload.is-active {
    background: rgba(59, 130, 246, 0.08);
    border-color: rgba(59, 130, 246, 0.18);
    color: #2563eb;
}

.dark .qm-type-editor-card {
    border-color: var(--qm-border-dark-600);
    background: var(--qm-bg-dark-800);
}

.dark .qm-type-editor-field__label,
.dark .qm-type-editor-card__title {
    color: var(--qm-text-secondary);
}

.dark .qm-type-editor-card__desc,
.dark .qm-type-editor-card--sidebar .qm-type-editor-field__label {
    color: var(--qm-text-muted);
}

.dark .qm-type-editor-field__input,
.dark .qm-type-editor-btn,
.dark .qm-type-editor-icon-btn {
    border-color: var(--qm-border-dark-600);
    background: var(--qm-bg-dark-700);
    color: var(--qm-text-secondary);
}

.dark .qm-type-editor-palette-input__swatch {
    border-color: var(--qm-border-dark-600);
    background: var(--qm-bg-dark-700);
}

.dark .qm-type-editor-icon-btn--tool.is-danger,
.dark .qm-type-editor-card--sidebar .qm-type-editor-icon-btn--tool.is-danger {
    border-color: transparent;
    background: transparent;
    color: #f87171;
}

.dark .qm-type-editor-icon-btn--tool.is-danger:hover,
.dark .qm-type-editor-icon-btn--tool.is-danger:focus-visible,
.dark .qm-type-editor-card--sidebar .qm-type-editor-icon-btn--tool.is-danger:hover,
.dark .qm-type-editor-card--sidebar .qm-type-editor-icon-btn--tool.is-danger:focus-visible {
    border-color: transparent;
    background: transparent;
    color: #fca5a5;
}

.dark .qm-type-editor-install-upload {
    border-color: rgba(96, 165, 250, 0.34);
    color: #93c5fd;
}

.dark .qm-type-editor-install-upload:hover,
.dark .qm-type-editor-install-upload:focus-visible {
    border-color: rgba(147, 197, 253, 0.58);
    background: rgba(96, 165, 250, 0.08);
}

.dark .qm-type-editor-install-upload.is-active {
    border-color: rgba(147, 197, 253, 0.22);
}

.dark .qm-type-editor-btn.is-subtle {
    background: var(--qm-bg-dark-700);
}

.dark .qm-type-editor-card--sidebar {
    border-color: transparent;
    background: transparent;
}

.dark .qm-type-editor-card--sidebar .qm-type-editor-row {
    border-top-color: rgba(148, 163, 184, 0.12);
}

.dark .qm-type-editor-icon-btn--tool.is-upload.is-active {
    background: rgba(96, 165, 250, 0.12);
    border-color: rgba(96, 165, 250, 0.2);
    color: #93c5fd;
}

.qm-editor-header__type-pages {
    margin-top: 16px;
}

.qm-admin-article-type-panel {
    margin: 16px 0 20px;
}

.wp-admin .qm-admin-article-type-panel .qm-article-type-switcher,
.wp-admin .qm-admin-article-type-panel .qm-type-editor-card {
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.04);
}

.wp-admin .qm-admin-article-type-panel .qm-article-type-switcher {
    margin-bottom: 16px;
}

@media (max-width: 991.98px) {
    .qm-article-type-modal {
        padding: 16px;
    }

    .qm-article-type-modal__dialog {
        max-height: calc(100vh - 32px);
        max-height: calc(100dvh - 32px);
        padding: 18px;
    }

    .qm-article-type-modal__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .qm-type-editor-grid,
    .qm-type-editor-grid--wide,
    .qm-type-editor-row,
    .qm-type-editor-row--media,
    .qm-type-editor-row--compact {
        grid-template-columns: minmax(0, 1fr);
    }

    .qm-type-editor-row__toolbar--feature,
    .qm-type-editor-row__toolbar--changelog,
    .qm-type-editor-row__toolbar--install,
    .qm-type-editor-row__toolbar--faq {
        grid-template-columns: minmax(0, 1fr);
        align-items: stretch;
    }

    .qm-type-editor-install-upload {
        width: 100%;
        min-width: 0;
        height: 54px;
    }

    .qm-material-gallery__grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .qm-article-type-switcher__tab {
        min-width: calc(50% - 4px);
    }
}

@media (max-width: 575.98px) {
    .qm-article-type-modal {
        align-items: center;
        padding: 12px;
    }

    .qm-article-type-switcher__trigger {
        width: 100%;
        justify-content: space-between;
    }

    .qm-article-type-modal__dialog {
        width: min(100%, 380px);
        max-height: calc(100vh - 24px);
        max-height: calc(100dvh - 24px);
        padding: 14px;
    }

    .qm-article-type-modal__head {
        gap: 8px;
        margin-bottom: 12px;
    }

    .qm-article-type-modal__title {
        font-size: 16px;
    }

    .qm-article-type-modal__close {
        width: 32px;
        height: 32px;
        font-size: 18px;
    }

    .qm-article-type-modal__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .qm-article-type-preview-card {
        gap: 6px;
        padding: 9px;
        border-radius: 10px;
    }

    .qm-article-type-preview-card__media {
        aspect-ratio: 148 / 96;
    }

    .qm-article-type-preview-card__svg {
        height: 100%;
        max-height: 72px;
    }

    .qm-article-type-preview-card__name {
        font-size: 13px;
        line-height: 1.4;
    }

    .qm-material-upload-panel {
        padding: 14px;
    }

    .qm-material-gallery__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .qm-material-gallery.is-empty .qm-material-gallery__add-card {
        min-height: 180px;
    }
}

@media (max-width: 359.98px) {
    .qm-article-type-modal {
        padding: 10px;
    }

    .qm-article-type-modal__dialog {
        width: min(100%, 340px);
        padding: 12px;
    }

    .qm-article-type-modal__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .qm-article-type-preview-card {
        padding: 8px;
    }

    .qm-article-type-preview-card__media {
        aspect-ratio: 144 / 92;
    }

    .qm-article-type-preview-card__svg {
        max-height: 64px;
    }
}
