/* Re-themed to SnapStatic dark + indigo by aliasing to styles-base --ss-* tokens. */
:root {
    --bg-primary: var(--ss-surface);
    --bg-secondary: var(--ss-bg);
    --bg-tertiary: var(--ss-surface-2);
    --text-primary: var(--ss-text);
    --text-secondary: var(--ss-text-dim);
    --text-muted: var(--ss-text-dim);
    --border-color: var(--ss-border);
    --accent: var(--ss-accent);
    --accent-hover: var(--ss-accent-hover);
    --warning: var(--ss-warn);
    --error: #ef4444;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 10px 24px rgba(0, 0, 0, 0.5);
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.6;
}

/* .container, header and footer are owned by the shared frame (styles-base.css). */

.hidden {
    display: none !important;
}

/* Header + tagline now rendered by the frame (.ss-nav + .tool-head). */

main {
    padding: 32px 16px;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.type-section {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.type-selector {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.type-selector label {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
}

.type-selector select {
    width: 100%;
    padding: 12px 16px;
    font-size: 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    outline: none;
    background: var(--bg-tertiary);
    cursor: pointer;
    transition: border-color 0.2s;
}

.type-selector select:focus {
    border-color: var(--accent);
}

.form-section {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.form-header {
    margin-bottom: 20px;
}

.form-header h2 {
    font-size: 18px;
    font-weight: 600;
}

.form-required-note {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.form-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    font-size: 15px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    outline: none;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: var(--accent);
}

.form-group input.error,
.form-group textarea.error {
    border-color: var(--error);
}

.form-group input.warning,
.form-group textarea.warning {
    border-color: var(--warning);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-error {
    font-size: 12px;
    color: var(--error);
    margin-top: 2px;
}

.form-hint {
    font-size: 12px;
    color: var(--text-muted);
}

.faq-item {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.faq-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.faq-item-header span {
    font-weight: 600;
    font-size: 14px;
}

.remove-btn {
    padding: 4px 12px;
    background: var(--error);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 12px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.remove-btn:hover {
    opacity: 0.8;
}

.breadcrumb-item,
.social-item {
    display: flex;
    gap: 8px;
    align-items: center;
}

.breadcrumb-item input,
.social-item input {
    flex: 1;
}

.add-btn {
    padding: 10px 16px;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 8px;
}

.add-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.preview-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.preview-section h2 {
    font-size: 18px;
    font-weight: 600;
}

/* Google rich-snippet mock — pinned light/white to mirror a real Google result. */
.snippet-preview {
    background: #ffffff;
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid #dadce0;
}

.snippet-preview .snippet-title {
    color: #1a0dab;
    font-size: 18px;
    line-height: 1.3;
    margin-bottom: 4px;
}

.snippet-preview .snippet-url {
    color: #006621;
    font-size: 14px;
    margin-bottom: 6px;
    word-break: break-all;
}

.snippet-preview .snippet-desc {
    color: #545454;
    font-size: 13px;
    line-height: 1.5;
}

.snippet-preview .snippet-row {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    font-size: 13px;
    color: #545454;
}

.snippet-preview .snippet-row span {
    background: #f1f3f4;
    color: #3c4043;
    padding: 2px 8px;
    border-radius: 4px;
}

/* FAQ rich result — questions stacked once each (mirrors Google's FAQ accordion). */
.snippet-preview .snippet-faq {
    margin-top: 10px;
}
.snippet-preview .snippet-faq-item {
    padding: 9px 0;
    border-top: 1px solid #ebebeb;
}
.snippet-preview .snippet-faq-q {
    color: #202124;
    font-size: 14px;
    font-weight: 500;
}
.snippet-preview .snippet-faq-a {
    color: #5f6368;
    font-size: 13px;
    margin-top: 2px;
    line-height: 1.5;
}

.output-section {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.output-header {
    margin-bottom: 16px;
}

.output-header h2 {
    font-size: 18px;
    font-weight: 600;
}

.output-content {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 16px;
    overflow-x: auto;
}

.output-content pre {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
}

.output-content code {
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-primary);
}

.output-actions {
    margin-top: 16px;
    display: flex;
    justify-content: flex-end;
}

.btn-primary {
    padding: 12px 24px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-primary:hover:not(:disabled) {
    background: var(--accent-hover);
}

.btn-primary:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
}

/* .footer and .toast are rendered/styled by the shared frame (styles-base.css). */

@media (max-width: 480px) {
    .header h1 {
        font-size: 22px;
    }

    .header .tagline {
        font-size: 14px;
    }

    main {
        padding: 20px 12px;
        gap: 20px;
    }

    .type-section,
    .form-section,
    .output-section {
        padding: 16px;
        border-radius: var(--radius-md);
    }

    .type-selector select {
        padding: 10px 12px;
        font-size: 14px;
    }

    .form-header h2 {
        font-size: 16px;
    }

    .faq-item {
        padding: 12px;
    }

    .breadcrumb-item,
    .social-item {
        flex-direction: column;
        align-items: stretch;
    }

    .breadcrumb-item input,
    .social-item input {
        width: 100%;
    }

    .output-actions {
        justify-content: stretch;
    }

    .btn-primary {
        width: 100%;
    }
}