body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    margin: 0;
}

h1 {
    font-size: 24px;
    margin: 0 0 8px;
}

p {
    color: #4b5563;
    margin: 0 0 16px;
}

.container {
    width: 100%;
    box-sizing: border-box;
}

.links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

.links a {
    text-decoration: none;
    color: #1d4ed8;
    font-size: 14px;
}

.links a:hover {
    text-decoration: underline;
}

input,
select,
textarea,
button {
    font: inherit;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    padding: 10px 12px;
    box-sizing: border-box;
}

button {
    cursor: pointer;
    border: none;
    background: #1d4ed8;
    color: #fff;
}

button.secondary {
    background: #4b5563;
}

button:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

.landing-page {
    background: #ffffff;
    color: #1a1a1a;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.landing-page .container {
    text-align: center;
    max-width: 500px;
    padding: 20px;
}

.landing-page p {
    margin-bottom: 24px;
}

.settings-page {
    background: #f5f7fb;
    color: #1f2937;
    padding: 24px;
}

.settings-page .container {
    max-width: 980px;
    margin: 0 auto;
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 8px 24px rgba(16, 24, 40, 0.08);
}

.row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.field {
    display: flex;
    flex-direction: column;
    min-width: 260px;
    flex: 1;
}

.field--compact {
    max-width: 220px;
}

label {
    font-size: 13px;
    color: #374151;
    margin-bottom: 6px;
}

.field-label {
    font-size: 13px;
    color: #374151;
    margin-bottom: 6px;
}

.radio-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #1f2937;
}

.radio-label input[type="radio"] {
    width: auto;
    margin: 0;
}

input[readonly] {
    background: #f3f4f6;
    color: #4b5563;
}

textarea {
    min-height: 96px;
    resize: vertical;
}

.template-card {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 10px;
    background: #fafafa;
}

.template-header {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 8px;
}

.template-preview {
    margin-top: 8px;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    padding: 10px;
    background: #ffffff;
}

.template-preview__title {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 6px;
}

.template-preview__body {
    font-size: 14px;
    color: #111827;
    line-height: 1.45;
}

#emailFormatStatus {
    margin-top: 8px;
}

.email-format-status--ok {
    color: #166534;
}

.email-format-status--error {
    color: #991b1b;
}

.actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.hint {
    font-size: 12px;
    color: #6b7280;
}

pre {
    background: #0b1020;
    color: #e5e7eb;
    border-radius: 10px;
    padding: 12px;
    overflow: auto;
    font-size: 12px;
    max-height: 260px;
}

.max-format-panel {
    border: 1px solid #c7d2fe;
    background: #eef2ff;
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 16px;
}

.max-format-panel h3 {
    margin: 0 0 8px;
    font-size: 15px;
    color: #312e81;
}

.max-format-panel__controls {
    margin-bottom: 8px;
}

.field--narrow {
    min-width: 200px;
    max-width: 320px;
    flex: 0 1 auto;
}

.max-format-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.max-format-toolbar__label {
    font-size: 13px;
    color: #4338ca;
    margin-right: 4px;
}

.max-format-panel .max-format-btn {
    padding: 6px 10px;
    font-size: 13px;
}
