.theme-edit-ticket-hint {
    margin: -8px 0 18px;
    padding: 10px 12px;
    border-left: 3px solid #f59e0b;
    border-radius: 4px;
    background: #fffbeb;
    color: #92400e;
    font-size: 13px;
    line-height: 1.6;
    letter-spacing: 0;
    overflow-wrap: anywhere;
}

.theme-edit-menu-item {
    min-height: 34px;
    white-space: nowrap;
}

.theme-edit-menu-link {
    display: flex;
    width: 100%;
    min-height: 34px;
    align-items: center;
    color: inherit;
    text-decoration: none;
}

.theme-edit-dialog-open {
    overflow: hidden;
}

.theme-edit-dialog-overlay {
    position: fixed;
    z-index: 10000;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(17, 24, 39, 0.58);
}

.theme-edit-dialog-overlay[hidden] {
    display: none;
}

.theme-edit-dialog {
    display: flex;
    width: min(100%, 460px);
    max-height: min(84vh, 760px);
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    color: #1f2937;
    box-shadow: 0 18px 48px rgba(17, 24, 39, 0.24);
}

.theme-edit-dialog-notice .theme-edit-dialog {
    width: min(100%, 680px);
}

.theme-edit-dialog-header,
.theme-edit-dialog-footer {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    padding: 14px 18px;
}

.theme-edit-dialog-header {
    justify-content: space-between;
    border-bottom: 1px solid #e5e7eb;
}

.theme-edit-dialog-header h2 {
    margin: 0;
    color: #111827;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: 0;
}

.theme-edit-dialog-close {
    display: inline-flex;
    width: 34px;
    height: 34px;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #4b5563;
    cursor: pointer;
    font-size: 26px;
    line-height: 1;
}

.theme-edit-dialog-close:hover,
.theme-edit-dialog-close:focus-visible {
    background: #f3f4f6;
    color: #111827;
    outline: 2px solid #2563eb;
    outline-offset: 1px;
}

.theme-edit-dialog-body {
    min-height: 0;
    overflow: auto;
    padding: 18px;
    overscroll-behavior: contain;
}

.theme-edit-dialog-footer {
    justify-content: flex-end;
    border-top: 1px solid #e5e7eb;
}

.theme-edit-dialog-confirm {
    min-width: 88px;
    min-height: 36px;
    border: 1px solid #1d4ed8;
    border-radius: 6px;
    background: #2563eb;
    color: #fff;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0;
}

.theme-edit-dialog-confirm:hover,
.theme-edit-dialog-confirm:focus-visible {
    background: #1d4ed8;
    outline: 2px solid #93c5fd;
    outline-offset: 2px;
}

.theme-edit-qr-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

.theme-edit-qr-code {
    display: flex;
    width: 256px;
    min-height: 256px;
    align-items: center;
    justify-content: center;
    padding: 8px;
    overflow: hidden;
    border: 1px solid #d1d5db;
    background: #fff;
}

.theme-edit-qr-code canvas,
.theme-edit-qr-code img {
    display: block;
    width: 240px;
    height: 240px;
    max-width: 100%;
    object-fit: contain;
}

.theme-edit-qr-error {
    color: #b91c1c;
    text-align: center;
}

.theme-edit-sensitive-note {
    margin: 0;
    color: #b45309;
    font-size: 13px;
    line-height: 1.6;
    text-align: center;
}

.theme-edit-notice-list {
    display: grid;
    gap: 22px;
}

.theme-edit-notice-article + .theme-edit-notice-article {
    padding-top: 22px;
    border-top: 1px solid #e5e7eb;
}

.theme-edit-notice-article > h3 {
    margin: 0 0 12px;
    color: #111827;
    font-size: 17px;
    font-weight: 600;
    line-height: 1.45;
    letter-spacing: 0;
}

.theme-edit-notice-article > time {
    display: block;
    margin-top: 14px;
    color: #6b7280;
    font-size: 12px;
}

.theme-edit-notice-image {
    display: block;
    width: auto;
    max-width: 100%;
    max-height: 360px;
    margin: 0 auto 14px;
    object-fit: contain;
}

.theme-edit-rich-html {
    overflow-wrap: anywhere;
    color: #374151;
    font-size: 14px;
    line-height: 1.75;
    white-space: pre-wrap;
    word-break: break-word;
}

.theme-edit-rich-html > :first-child {
    margin-top: 0;
}

.theme-edit-rich-html > :last-child {
    margin-bottom: 0;
}

.theme-edit-rich-html p,
.theme-edit-rich-html ul,
.theme-edit-rich-html ol,
.theme-edit-rich-html blockquote,
.theme-edit-rich-html pre,
.theme-edit-rich-html table,
.theme-edit-rich-html figure,
.theme-edit-rich-html details {
    margin: 0 0 12px;
    white-space: normal;
}

.theme-edit-rich-html h1,
.theme-edit-rich-html h2,
.theme-edit-rich-html h3,
.theme-edit-rich-html h4,
.theme-edit-rich-html h5,
.theme-edit-rich-html h6 {
    margin: 18px 0 8px;
    color: #111827;
    font-weight: 600;
    line-height: 1.45;
    letter-spacing: 0;
}

.theme-edit-rich-html h1 { font-size: 22px; }
.theme-edit-rich-html h2 { font-size: 20px; }
.theme-edit-rich-html h3 { font-size: 18px; }
.theme-edit-rich-html h4,
.theme-edit-rich-html h5,
.theme-edit-rich-html h6 { font-size: 16px; }

.theme-edit-rich-html ul,
.theme-edit-rich-html ol {
    padding-left: 24px;
}

.theme-edit-rich-html ul { list-style: disc; }
.theme-edit-rich-html ol { list-style: decimal; }
.theme-edit-rich-html li + li { margin-top: 4px; }

.theme-edit-rich-html a {
    color: #1d4ed8;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.theme-edit-rich-html img {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: 560px;
    margin: 10px auto;
    object-fit: contain;
}

.theme-edit-rich-html blockquote {
    padding: 10px 14px;
    border-left: 4px solid #60a5fa;
    background: #f8fafc;
    color: #4b5563;
}

.theme-edit-rich-html code,
.theme-edit-rich-html kbd {
    border-radius: 4px;
    background: #f3f4f6;
    color: #9f1239;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.92em;
}

.theme-edit-rich-html code { padding: 2px 5px; }

.theme-edit-rich-html pre {
    padding: 12px 14px;
    overflow-x: auto;
    border: 1px solid #d1d5db;
    background: #111827;
    color: #f9fafb;
    line-height: 1.6;
}

.theme-edit-rich-html pre code {
    padding: 0;
    background: transparent;
    color: inherit;
}

.theme-edit-rich-html table {
    display: block;
    width: 100%;
    overflow-x: auto;
    border-collapse: collapse;
}

.theme-edit-rich-html th,
.theme-edit-rich-html td {
    min-width: 90px;
    padding: 8px 10px;
    border: 1px solid #d1d5db;
    text-align: left;
    vertical-align: top;
    white-space: normal;
}

.theme-edit-rich-html th {
    background: #f3f4f6;
    color: #111827;
    font-weight: 600;
}

.theme-edit-rich-html hr {
    margin: 18px 0;
    border: 0;
    border-top: 1px solid #d1d5db;
}

.theme-edit-rich-html mark {
    padding: 1px 3px;
    background: #fef08a;
    color: #713f12;
}

.theme-edit-rich-html details {
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
}

.theme-edit-rich-html summary {
    cursor: pointer;
    color: #111827;
    font-weight: 600;
}

@media (max-width: 520px) {
    .theme-edit-dialog-overlay {
        align-items: flex-end;
        padding: 10px;
    }

    .theme-edit-dialog {
        width: 100%;
        max-height: 88vh;
    }

    .theme-edit-dialog-header,
    .theme-edit-dialog-footer {
        padding: 12px 14px;
    }

    .theme-edit-dialog-body {
        padding: 14px;
    }

    .theme-edit-qr-code {
        width: min(256px, 100%);
        min-height: 0;
        aspect-ratio: 1;
    }
}
