.lg-header { margin-bottom: 24px; }
.lg-title { font-size: 28px; font-weight: 700; color: #111827; margin: 0 0 8px; }
.lg-desc { font-size: 15px; color: #6b7280; margin: 0; }

.lg-calculator { padding: 24px; }

.lg-gates { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; padding-bottom: 16px; border-bottom: 1px solid #e5e7eb; }
.lg-gate { padding: 10px 20px; border: 1px solid #e5e7eb; border-radius: 20px; background: white; font-size: 14px; font-weight: 500; cursor: pointer; transition: all 0.2s; }
.lg-gate:hover { border-color: #3b82f6; color: #3b82f6; }
.lg-gate.active { background: #3b82f6; border-color: #3b82f6; color: white; }

.lg-circuit { display: flex; align-items: center; justify-content: center; gap: 32px; padding: 32px; background: #f9fafb; border-radius: 12px; margin-bottom: 16px; }

.lg-inputs { display: flex; flex-direction: column; gap: 16px; }
.lg-switch { display: flex; align-items: center; gap: 12px; font-size: 18px; font-weight: 600; color: #374151; cursor: pointer; }
.lg-switch input { display: none; }
.lg-toggle { width: 52px; height: 28px; background: #e5e7eb; border-radius: 14px; position: relative; transition: background 0.3s; }
.lg-toggle::after { content: ''; position: absolute; left: 2px; top: 2px; width: 24px; height: 24px; background: white; border-radius: 50%; transition: transform 0.3s; box-shadow: 0 1px 3px rgba(0,0,0,0.2); }
.lg-switch input:checked + .lg-toggle { background: #10b981; }
.lg-switch input:checked + .lg-toggle::after { transform: translateX(24px); }
.lg-value { font-family: monospace; font-size: 20px; font-weight: 700; color: #6b7280; min-width: 24px; text-align: center; }
.lg-value.on { color: #10b981; }

.lg-gate-symbol { width: 80px; height: 80px; display: flex; align-items: center; justify-content: center; background: #3b82f6; color: white; font-size: 36px; font-weight: 700; border-radius: 12px; }

.lg-output { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.lg-output span:first-child { font-size: 13px; color: #6b7280; }
.lg-output-value { width: 64px; height: 64px; display: flex; align-items: center; justify-content: center; background: #ef4444; color: white; font-size: 28px; font-weight: 700; border-radius: 12px; transition: background 0.3s; }
.lg-output-value.on { background: #10b981; }

.lg-expression { text-align: center; padding: 16px; background: #eff6ff; border-radius: 8px; font-family: monospace; font-size: 16px; color: #3b82f6; font-weight: 500; }

.lg-truth-table { padding: 24px; }
.lg-truth-table h3 { font-size: 16px; font-weight: 600; margin: 0 0 16px; }
.lg-table-wrap { overflow-x: auto; }
.lg-table-wrap table { width: 100%; border-collapse: collapse; font-size: 14px; }
.lg-table-wrap th { background: #f9fafb; padding: 12px 16px; font-weight: 600; color: #374151; border-bottom: 2px solid #e5e7eb; text-align: center; }
.lg-table-wrap td { padding: 12px 16px; text-align: center; border-bottom: 1px solid #f3f4f6; }
.lg-table-wrap tr:hover td { background: #f9fafb; }
.lg-table-wrap .highlight { background: #ecfdf5 !important; font-weight: 600; color: #10b981; }
.lg-bit { display: inline-block; width: 28px; height: 28px; line-height: 28px; border-radius: 6px; font-weight: 600; }
.lg-bit.on { background: #10b981; color: white; }
.lg-bit.off { background: #f3f4f6; color: #6b7280; }

.lg-guide { padding: 20px; }
.lg-guide h3 { font-size: 16px; font-weight: 600; margin: 0 0 16px; }
.lg-guide-content { display: grid; gap: 16px; }
.lg-gate-info { padding: 16px; background: #f9fafb; border-radius: 8px; }
.lg-gate-info h4 { font-size: 14px; font-weight: 600; margin: 0 0 8px; color: #3b82f6; }
.lg-gate-info p { font-size: 13px; color: #6b7280; margin: 0; line-height: 1.6; }

@media (max-width: 640px) {
    .lg-title { font-size: 22px; }
    .lg-circuit { flex-direction: column; gap: 20px; padding: 24px; }
    .lg-inputs { flex-direction: row; gap: 24px; }
}

@media (prefers-color-scheme: dark) {
    .lg-gate { background: #1f2937; border-color: #374151; }
    .lg-circuit { background: #1f2937; }
    .lg-expression { background: #1e3a5f; }
    .lg-table-wrap th { background: #1f2937; }
    .lg-gate-info { background: #1f2937; }
}
