.sg-container {
    max-width: 800px;
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.sg-form {
    background: #f9f9f9;
    padding: 25px;
    border-radius: 8px;
    border: 1px solid #ddd;
}
.sg-field {
    margin-bottom: 15px;
}
.sg-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
}
.sg-field input,
.sg-field select,
.sg-field textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}
.sg-field input[type="text"],
.sg-field input[type="number"],
.sg-field input[type="date"] {
    max-width: 400px;
}
.sg-field small {
    display: block;
    color: #666;
    margin-top: 4px;
    font-size: 12px;
}
.sg-field textarea {
    font-family: monospace;
    font-size: 14px;
    resize: vertical;
}
.sg-toggle {
    margin-bottom: 15px;
}
.sg-toggle label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-weight: 600;
}
.sg-toggle input[type="checkbox"] {
    width: auto;
}
.sg-advanced {
    margin: 15px 0;
    padding: 12px 35px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
}
.sg-advanced summary {
    cursor: pointer;
    font-weight: 600;
    color: #0073aa;
    user-select: none;
}
.sg-advanced[open] summary {
    margin-bottom: 12px;
}
.sg-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 20px;
}
.sg-button {
    background: #0073aa;
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.2s;
}
.sg-button:hover {
    background: #005a87;
}
.sg-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
.sg-reset-btn {
    background: #6c757d;
}
.sg-reset-btn:hover {
    background: #5a6268;
}
.sg-download-btn {
    background: #28a745;
}
.sg-download-btn:hover {
    background: #218838;
}
.sg-copy-btn {
    background: #2c3e50;
}
.sg-copy-btn:hover {
    background: #1a252f;
}
.sg-loading {
    margin-top: 25px;
    text-align: center;
    padding: 30px;
}
.sg-loading p {
    margin-top: 12px;
    color: #666;
    font-size: 14px;
}
.sg-spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto;
    border: 4px solid #e0e0e0;
    border-top-color: #0073aa;
    border-radius: 50%;
    animation: sg-spin 0.8s linear infinite;
}
@keyframes sg-spin {
    to { transform: rotate(360deg); }
}
#sg-result {
    margin-top: 25px;
    background: #f0f7ff;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #0073aa;
}
#sg-result h3 {
    margin-top: 0;
    color: #0073aa;
}
#sg-stats {
    font-size: 15px;
    margin-bottom: 15px;
}
.sg-result-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}
#sg-preview-box {
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 15px;
    border-radius: 6px;
    overflow-x: auto;
    max-height: 400px;
    overflow-y: auto;
}
#sg-preview {
    margin: 0;
    white-space: pre;
    font-family: "Courier New", monospace;
    font-size: 13px;
    line-height: 1.5;
    word-break: break-all;
}
#sg-explanation {
    margin-top: 18px;
    padding: 14px;
    background: #fff;
    border-radius: 4px;
    border: 1px solid #cce5ff;
    color: #004085;
}
#sg-explanation code {
    background: #e9ecef;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 13px;
}