/* Vectis.AI Core - Matching vectis.ai aesthetic */

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #000;
    color: #fff;
    min-height: 100vh;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header with Logo */
.site-header {
    padding: 24px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff;
}

.logo-img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.logo-img-small {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.wordmark {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 80px 0 40px;
}

.hero h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 16px;
    color: #fff;
}

.hero .subtitle {
    font-size: 1.05rem;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 400;
}

/* Input Section */
.input-section {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 40px;
    margin-bottom: 40px;
}

.input-section h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: #fff;
}

textarea {
    width: 100%;
    padding: 16px;
    font-family: 'Inter', monospace;
    font-size: 15px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: #fff;
    resize: vertical;
    margin-bottom: 20px;
    transition: border-color 0.2s;
}

textarea:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.3);
}

textarea::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.modal-open {
    overflow: hidden;
}

.manufacturer-card {
    margin-top: 24px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 24px;
}

.manufacturer-header h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 4px;
}

.manufacturer-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    margin-top: 20px;
}

.manufacturer-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
}

.manufacturer-field input {
    padding: 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.03);
    color: #fff;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    transition: border-color 0.2s;
}

.manufacturer-field input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.manufacturer-field input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.3);
}

/* Buttons */
.actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.btn-primary,
.btn-secondary,
.btn-download {
    padding: 14px 28px;
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 0.2px;
}

.btn-primary {
    background: #fff;
    color: #000;
    box-shadow: 0 2px 8px rgba(255, 255, 255, 0.1);
}

.btn-primary:hover {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

.btn-download {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-download:hover {
    background: rgba(255, 255, 255, 0.1);
}

.btn-compact {
    padding: 10px 16px;
    font-size: 0.85rem;
}

/* Loading */
.loading {
    text-align: center;
    padding: 60px 20px;
    color: rgba(255, 255, 255, 0.7);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Error */
.error {
    background: rgba(220, 53, 69, 0.1);
    border: 1px solid rgba(220, 53, 69, 0.3);
    color: #ff6b6b;
    padding: 16px;
    border-radius: 8px;
    margin: 20px 0;
}

/* Results */
#results {
    margin-top: 40px;
}

.result-header {
    margin-bottom: 30px;
}

.result-header h3 {
    font-size: 1.8rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 8px;
}

.design-id {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.95rem;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 30px;
    overflow-x: auto;
}

.tab {
    padding: 12px 20px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: rgba(255, 255, 255, 0.6);
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.tab:hover {
    color: #fff;
}

.tab.active {
    color: #fff;
    border-bottom-color: #fff;
}

/* Tab Panes */
.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

.section-header {
    margin-bottom: 24px;
}

.section-header h4 {
    font-size: 1.3rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 6px;
}

.section-subtitle {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.95rem;
}

/* Components Grid */
.components-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.component-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
    transition: all 0.2s;
}

.component-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
}

.component-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.component-header h5 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
}

.price {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.95rem;
    font-weight: 500;
}

.component-description {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
    margin-bottom: 16px;
    line-height: 1.5;
}

.component-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.detail {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.85rem;
}

.detail strong {
    color: rgba(255, 255, 255, 0.7);
}

.badge-connectivity {
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* Compliance Scorecard */
.scorecard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin-bottom: 30px;
}

.score-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 20px;
    text-align: center;
}

.score-item .count {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.score-item.passed .count {
    color: #52c41a;
}

.score-item.warning .count {
    color: #faad14;
}

.score-item.failed .count {
    color: #f5222d;
}

.score-item .label {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
}

.compliance-summary {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
}

.self-cert-summary {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
    display: none;
}

.self-cert-summary.visible {
    display: block;
}

.self-cert-header {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}

.self-cert-pill {
    align-self: flex-start;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.self-cert-pill.status-eligible {
    background: rgba(82, 196, 26, 0.15);
    color: #52c41a;
}

.self-cert-pill.status-caution {
    background: rgba(250, 173, 20, 0.18);
    color: #faad14;
}

.self-cert-pill.status-blocked {
    background: rgba(245, 34, 45, 0.18);
    color: #ff7875;
}

.self-cert-summary p {
    color: rgba(255, 255, 255, 0.68);
    font-size: 0.95rem;
    line-height: 1.5;
}

.self-cert-domains {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.self-cert-domains .badge {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    font-size: 0.75rem;
    padding: 4px 10px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.self-cert-list {
    margin-left: 18px;
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.9rem;
    line-height: 1.5;
}

.self-cert-notes {
    margin-top: 12px;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.55);
}

.compliance-summary h5 {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.summary-status {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.summary-status .status-label {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
}

.domain-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.domain-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.domain-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.domain-card.status-pass {
    border-color: rgba(82, 196, 26, 0.4);
}

.domain-card.status-warning {
    border-color: rgba(250, 173, 20, 0.4);
}

.domain-card.status-fail {
    border-color: rgba(245, 34, 45, 0.4);
}

.domain-card h5 {
    font-size: 1rem;
    font-weight: 600;
}

.domain-description {
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.9rem;
    line-height: 1.5;
}

.domain-counts {
    display: flex;
    gap: 12px;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
}

.domain-counts span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.ce-docs-summary {
    margin-top: 24px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 24px;
}

.ce-docs-summary h5 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 6px;
}

.ce-docs-subtitle {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
    margin-bottom: 16px;
}

.ce-docs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
}

.ce-doc-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.ce-doc-card:hover {
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.ce-doc-card-body h6 {
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 6px;
}

.ce-doc-card-body p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
    line-height: 1.4;
}

.ce-doc-actions {
    display: flex;
    gap: 10px;
}

.ce-checklist {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
}

.ce-checklist h5 {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 12px;
}

.ce-checklist ol {
    margin-left: 18px;
    display: grid;
    gap: 8px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Compliance Checks */
.compliance-check {
    background: rgba(255, 255, 255, 0.03);
    border-left: 3px solid;
    padding: 16px;
    margin-bottom: 12px;
    border-radius: 6px;
}

.compliance-check.pass {
    border-left-color: #52c41a;
}

.compliance-check.warning {
    border-left-color: #faad14;
}

.compliance-check.fail {
    border-left-color: #f5222d;
}

.check-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.badge {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge.pass {
    background: rgba(82, 196, 26, 0.15);
    color: #52c41a;
}

.badge.warning {
    background: rgba(250, 173, 20, 0.15);
    color: #faad14;
}

.badge.fail {
    background: rgba(245, 34, 45, 0.15);
    color: #f5222d;
}

.check-message {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 12px;
    line-height: 1.6;
}

/* Technical Details Sections */
.technical-details,
.test-requirement,
.recommendation,
.regulation-ref {
    margin-top: 16px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.02);
    border-left: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

.technical-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.technical-label svg {
    opacity: 0.6;
}

.technical-details p,
.test-requirement p,
.recommendation p,
.regulation-ref p {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
    line-height: 1.6;
}

.test-requirement {
    border-left-color: rgba(82, 196, 26, 0.3);
    background: rgba(82, 196, 26, 0.03);
}

.recommendation {
    border-left-color: rgba(250, 173, 20, 0.3);
    background: rgba(250, 173, 20, 0.03);
}

.regulation-ref {
    border-left-color: rgba(66, 135, 245, 0.3);
    background: rgba(66, 135, 245, 0.03);
}

/* Regulations Summary */
.regulations-summary {
    margin-top: 40px;
    padding: 24px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
}

.regulations-summary h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 16px;
}

.regulations-summary ul {
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 8px;
    margin-bottom: 16px;
}

.regulations-summary ul li {
    display: flex;
    align-items: center;
}

.regulations-summary code {
    background: rgba(255, 255, 255, 0.1);
    padding: 4px 10px;
    border-radius: 4px;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.9);
}

.regulation-note {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.85rem;
    font-style: italic;
    margin: 16px 0 0;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* BOM Table */
.bom-table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    overflow: hidden;
}

.bom-table thead {
    background: rgba(255, 255, 255, 0.05);
}

.bom-table th {
    padding: 12px;
    text-align: left;
    font-size: 0.85rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.bom-table td {
    padding: 12px;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* JSON View */
.json-view {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 20px;
    color: rgba(255, 255, 255, 0.8);
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 0.85rem;
    overflow-x: auto;
    line-height: 1.5;
}

/* Download Section */
.download-section {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.download-section h4 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: #fff;
}

.download-groups {
    display: grid;
    gap: 24px;
}

.download-group h5 {
    font-size: 1rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 12px;
}

.download-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.btn-download:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.preview-modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 1000;
}

.preview-modal.visible {
    pointer-events: auto;
    opacity: 1;
}

.preview-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
}

.preview-dialog {
    position: relative;
    width: min(900px, 92vw);
    height: min(80vh, 720px);
    background: rgba(12, 12, 12, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
    z-index: 1001;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.preview-header h4 {
    font-size: 1.2rem;
    margin-bottom: 4px;
}

.preview-subtitle {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
}

.preview-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.preview-body {
    flex: 1;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: #ffffff;
}

.preview-body iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: #fff;
}

/* Footer */
.site-footer {
    margin-top: 80px;
    padding: 60px 0 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 30px;
}

.footer-left {
    text-align: left;
}

.footer-right {
    text-align: right;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.footer-wordmark {
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: #fff;
}

.footer-info,
.footer-tagline,
.footer-vat {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.95rem;
    margin: 6px 0;
}

.footer-email {
    color: #fff;
    text-decoration: none;
    font-size: 0.95rem;
    margin: 6px 0;
    display: inline-block;
}

.footer-email:hover {
    text-decoration: underline;
}

.footer-philosophy {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.95rem;
    font-style: italic;
    margin: 6px 0;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-bottom p {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.85rem;
    margin: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2rem;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .footer-philosophy {
        text-align: left;
    }

    .components-grid {
        grid-template-columns: 1fr;
    }
}

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

.link-chip {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 999px;
    color: #fff;
    font-size: 0.8rem;
    padding: 6px 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.link-chip:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.25);
}

.link-chip:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.25);
}

.component-card.highlight {
    border-color: rgba(76, 175, 80, 0.9);
    box-shadow: 0 0 18px rgba(76, 175, 80, 0.45);
}

.schematic-layout {
    display: grid;
    gap: 24px;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    align-items: start;
}

.schematic-canvas {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 12px;
    overflow: auto;
    max-height: 520px;
}

.layout-panels {
    display: grid;
    gap: 16px;
}

.layout-panel {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 16px;
}

.layout-panel h5 {
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 4px;
}

.panel-subtitle {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.55);
    margin-bottom: 12px;
}

.placement-grid,
.trace-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.placement-row,
.trace-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
    color: #fff;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.placement-row:hover,
.trace-row:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.placement-label,
.trace-label {
    font-weight: 600;
    font-size: 0.95rem;
}

.placement-meta,
.trace-meta {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
}

.placement-row.highlight,
.trace-row.highlight {
    border-color: rgba(76, 175, 80, 0.9);
    box-shadow: 0 0 14px rgba(76, 175, 80, 0.35);
}

#schematicView svg .block-group.highlight rect {
    stroke: #4caf50 !important;
    stroke-width: 4 !important;
    filter: drop-shadow(0 0 8px rgba(76, 175, 80, 0.6));
}

#schematicView svg .block-group.highlight .label {
    fill: #ffffff !important;
    font-weight: 600;
}

#schematicView svg .trace-group.highlight .trace {
    stroke-width: 4 !important;
    filter: drop-shadow(0 0 8px rgba(33, 150, 243, 0.7));
}

#schematicView svg .trace-group.highlight .conn-label {
    fill: #bbdefb !important;
    font-weight: 600;
}

@media (max-width: 900px) {
    .schematic-layout {
        grid-template-columns: 1fr;
    }

    .schematic-canvas {
        max-height: none;
    }
}