.mtg-form {
    max-width: 980px;
    margin: 0 auto;
    padding: 24px;
    border-radius: 20px;
    background: linear-gradient(180deg, #ffffff 0%, #f6f8fb 100%);
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.08);
}
.mtg-form__title {
    margin: 0 0 8px;
    font-size: 32px;
    line-height: 1.15;
}
.mtg-form__title--small {
    font-size: 24px;
}
.mtg-form__intro {
    position: relative;
    margin: 20px 0 24px;
    padding: 14px 16px;
    padding-right: 44px;
    border: 1px solid #d8e1ea;
    border-radius: 14px;
    background: #f6f8fb;
    color: #334155;
    line-height: 1.6;
}
.mtg-form__section {
    margin-top: 24px;
    padding: 20px;
    border: 1px solid #dbe4ee;
    border-radius: 16px;
    background: #fff;
}
.mtg-form__section h2 {
    margin: 0 0 16px;
    font-size: 22px;
}
.mtg-form__grid {
    display: grid;
    gap: 16px;
}
.mtg-form__grid--two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.mtg-form__field label,
.mtg-form__choice-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
}
.mtg-form__field[hidden] {
    display: none !important;
}
.mtg-form__field.is-full-width {
    grid-column: 1 / -1;
}
.mtg-form__pair-title {
    grid-column: 1 / -1;
    margin: 0 0 -6px;
    font-weight: 700;
    color: #0f172a;
}
.mtg-form input[type="text"],
.mtg-form select,
.mtg-form textarea {
    width: 100%;
    padding: 8px 14px;
    border: 1px solid #cbd5e1;
    background: #fff;
    box-sizing: border-box;
    font: inherit;
}
.mtg-form textarea {
    resize: vertical;
}
.mtg-form--feedback {
    margin-top: 12px;
    padding-top: 18px;
    padding-bottom: 18px;
}
.mtg-form__feedback-form {
    margin-top: 0;
}
.mtg-form__feedback-row {
    display: grid;
    gap: 12px;
}
.mtg-form__feedback-rating-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}
.mtg-form__feedback-label {
    font-weight: 600;
}
.mtg-form__feedback-rating {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.mtg-form__feedback-option {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}
.mtg-form__feedback-option input[type="radio"] {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: #0f766e;
}
.mtg-form__feedback-option span {
    line-height: 1;
}
#mtg-feedback-comment {
    min-height: 40px;
    resize: vertical;
}
.mtg-form__choices {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}
.mtg-form__choice {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    background: #f8fafc;
}
.mtg-form__choices--editor-mode {
    margin-bottom: 12px;
}
.mtg-form__editor-note {
    position: relative;
    margin: 0 0 12px;
    padding: 12px 14px;
    padding-right: 40px;
    border-radius: 12px;
}
.mtg-form__editor-note--info {
    border: 1px solid #d8e1ea;
    background: #f6f8fb;
    color: #334155;
}
.mtg-form__editor-note--warning {
    border: 1px solid #f5c47a;
    background: #fff7e8;
    color: #7c4a03;
}
.mtg-form__editor-note[hidden] {
    display: none;
}
.mtg-form__message-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: inherit;
    font: inherit;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    opacity: 0.75;
}
.mtg-form__message-close:hover {
    opacity: 1;
    background: rgba(15, 23, 42, 0.08);
}
.mtg-form__plain-editor[hidden] {
    display: none;
}
.mtg-form__authors {
    display: grid;
    gap: 16px;
}
.mtg-form__author {
    padding: 16px;
    border: 1px solid #dbe4ee;
    border-radius: 14px;
    background: #f8fafc;
}
.mtg-form__author-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}
.mtg-form__author-title {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
}
.mtg-form__inline-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}
.mtg-form__input-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}
.mtg-form__input-row input {
    flex: 1 1 auto;
}
.mtg-form__keywords-wrap {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    min-height: 48px;
    padding: 12px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    background: #fff;
    box-sizing: border-box;
    cursor: text;
}
.mtg-form__keywords-wrap input {
    flex: 1 1 180px;
    min-width: 140px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}
.mtg-form__keywords-wrap input:focus {
    outline: none;
}
.mtg-form__keywords-wrap.is-previewing input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.mtg-form__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}
.mtg-form__keywords-wrap .mtg-form__tags {
    margin-top: 0;
    width: 100%;
}
.mtg-form__keywords-wrap.is-editing .mtg-form__tags {
    display: none;
}
.mtg-form__keywords-wrap.is-previewing .mtg-form__tags {
    display: flex;
}
.mtg-form__tag {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 999px;
    background: #dbf4ec;
    color: #0f766e;
    font-size: 14px;
    line-height: 1.2;
}
.mtg-form__references-wrap {
    min-height: 140px;
    align-items: flex-start;
}
.mtg-form__references-wrap.is-previewing {
    cursor: text;
}
.mtg-form__references-wrap textarea {
    width: 100%;
    min-height: 112px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    resize: none;
}
.mtg-form__references-wrap textarea:focus {
    outline: none;
}
.mtg-form__references-wrap.is-previewing textarea {
    display: none;
}
.mtg-form__references-wrap.is-editing .mtg-form__tags {
    display: none;
}
.mtg-form__references-wrap.is-previewing .mtg-form__tags {
    display: flex;
    width: 100%;
}
.mtg-form__reference-tag {
    width: 100%;
    justify-content: flex-start;
    align-items: flex-start;
    white-space: normal;
    border-radius: 16px;
    padding: 12px 14px;
    line-height: 1.45;
}
.mtg-form__warnings {
    margin-top: 20px;
    padding: 14px 16px;
    border: 1px solid #f5c47a;
    border-radius: 14px;
    background: #fff7e8;
    color: #7c4a03;
}
.mtg-form__warnings[hidden] {
    display: none;
}
.mtg-form__warnings-title {
    margin: 0 0 8px;
    font-size: 15px;
    font-weight: 700;
}
.mtg-form__warnings-list {
    margin: 0;
    padding-left: 18px;
}
.mtg-form__warnings-list li + li {
    margin-top: 6px;
}
.mtg-form__small-button {
    padding: 8px 12px;
    border: 1px solid #94a3b8;
    border-radius: 10px;
    background: #fff;
    color: #0f172a;
    font: inherit;
    cursor: pointer;
}
.mtg-form__small-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.mtg-form__small-button[hidden] {
    display: none;
}
.mtg-form__actions {
    margin-top: 24px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}
.mtg-form__submit {
    min-width: 220px;
    padding: 12px 18px;
    border: 0;
    border-radius: 12px;
    background: #0f766e;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
}
@media (max-width: 782px) {
    .mtg-form {
        padding: 18px;
    }

    .mtg-form__grid--two {
        grid-template-columns: 1fr;
    }
}
