.dr-calc-wrapper * { box-sizing: border-box; margin: 0; padding: 0; }
.dr-calc-wrapper { font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; max-width: 720px; width: 100%; margin: 24px auto; color: #1e293b; }
.calculator-hero { text-align: center; padding: 16px 0 8px; margin-bottom: 0; }
.calculator-hero h1 { font-size: 1.75rem; font-weight: 800; margin-bottom: 12px; background: linear-gradient(135deg, #5b21b6, #8b5cf6); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; line-height: 1.2; letter-spacing: -0.02em; }
.calculator-hero p { font-size: 1rem; color: #64748b; max-width: 600px; margin: 0 auto; line-height: 1.6; padding: 0 10px; }
.calc-main-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin: 24px 0; }
.left-panel, .right-panel { background: #ffffff; border: 1px solid #f1f5f9; border-radius: 16px; padding: 20px; min-height: 400px; }
.left-panel h2, .right-panel h2 { font-size: 0.875rem; font-weight: 700; color: #0f172a; margin-bottom: 16px; text-transform: uppercase; letter-spacing: 0.05em; }
.mode-selector { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.mode-option { position: relative; }
.mode-option input[type="radio"] { position: absolute; opacity: 0; cursor: pointer; }
.mode-label { display: flex; align-items: center; padding: 10px 12px; cursor: pointer; border-radius: 8px; transition: background 0.2s; }
.mode-label:hover { background: #f8fafc; }
.radio-circle { width: 18px; height: 18px; border: 2px solid #cbd5e1; border-radius: 50%; margin-right: 12px; flex-shrink: 0; position: relative; transition: all 0.2s; }
.mode-option input[type="radio"]:checked + .mode-label .radio-circle { border-color: #5b21b6; background: #5b21b6; }
.mode-option input[type="radio"]:checked + .mode-label .radio-circle::after { content: ''; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 6px; height: 6px; background: white; border-radius: 50%; }
.mode-text { font-weight: 600; color: #334155; font-size: 0.9375rem; transition: color 0.2s; flex: 1; }
.mode-option input[type="radio"]:checked + .mode-label { background: #f5f3ff; }
.mode-option input[type="radio"]:checked + .mode-label .mode-text { color: #5b21b6; }
.formula-wrapper { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 12px; padding: 16px; text-align: center; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; }
.formula-heading { font-size: 0.75rem; font-weight: 700; color: #64748b; text-transform: uppercase; letter-spacing: 0.08em; }
.formula-wrapper .katex { font-size: 1.3rem; }
.param-desc { font-size: 0.75rem; color: #64748b; line-height: 1.5; max-width: 100%; word-wrap: break-word; }
.input-section { display: flex; flex-direction: column; gap: 16px; }
.input-group { display: flex; flex-direction: column; gap: 6px; }
.input-label { font-weight: 600; font-size: 0.8125rem; color: #475569; }
.input-label.result-label { color: #5b21b6; }
.input-field { display: flex; border: 1px solid #e2e8f0; border-radius: 10px; background: white; transition: all 0.2s; }
.input-field:focus-within { border-color: #8b5cf6; box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.15); }
.input-field input { flex: 1; border: none; border-radius: 10px 0 0 10px; padding: 12px 16px; font-size: 1rem; font-family: inherit; color: #0f172a; min-width: 0; }
.input-field input:focus { outline: none; }
.input-field input.result-input { background: #f5f3ff; font-weight: 600; color: #5b21b6; }
.custom-select-wrapper { position: relative; min-width: 50px; border-left: 1px solid #e2e8f0; background: #f8fafc; border-radius: 0 10px 10px 0; flex-shrink: 0; }
.custom-select-trigger { padding: 12px 10px; font-size: 0.8125rem; font-weight: 600; color: #475569; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.custom-select-trigger::after { content: '▼'; font-size: 0.6rem; color: #94a3b8; margin-left: 4px; }
.custom-options { position: absolute; top: 100%; right: 0; left: auto; background: white; border: 1px solid #e2e8f0; border-radius: 10px; box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1); z-index: 100; display: none; margin-top: 4px; min-width: 280px; max-width: 360px; max-height: 300px; overflow-y: auto; }
.custom-options.open { display: block; }
.custom-option { padding: 10px 16px; font-size: 0.875rem; color: #334155; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: background 0.2s; }
.custom-option:hover { background: #f5f3ff; color: #5b21b6; }
.custom-option.selected { background: #ede9fe; font-weight: 600; color: #5b21b6; }
.calc-error { display: none; background-color: #fef2f2; color: #b91c1c; font-size: 0.8125rem; margin-top: 8px; padding: 10px 12px; border-radius: 8px; border: 1px solid #fee2e2; font-weight: 500; align-items: center; gap: 8px; line-height: 1.4; }
.calc-error::before { content: '⚠️'; font-size: 0.9rem; }
.ratio-input-group { display: flex; align-items: center; gap: 10px; border: 1px solid #e2e8f0; border-radius: 10px; background: white; padding: 8px 12px; transition: all 0.2s; }
.ratio-input-group:focus-within { border-color: #8b5cf6; box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.15); }
.ratio-input-box { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.ratio-input-box input { border: none; padding: 6px 8px; font-size: 1rem; font-family: inherit; color: #0f172a; text-align: center; background: #f8fafc; border-radius: 6px; min-width: 0; }
.ratio-input-box input:focus { outline: none; background: #ede9fe; }
.ratio-input-box .ratio-placeholder { font-size: 0.6875rem; color: #94a3b8; text-align: center; font-weight: 500; }
.ratio-colon { font-size: 1.5rem; font-weight: 700; color: #64748b; padding: 0 4px; user-select: none; }
.ratio-result-display { background: #f5f3ff; border: 2px solid #8b5cf6; border-radius: 12px; padding: 20px; text-align: center; display: flex; align-items: center; justify-content: center; gap: 16px; }
.ratio-result-box { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.ratio-result-box .ratio-value { font-size: 2rem; font-weight: 700; color: #5b21b6; font-family: 'Courier New', monospace; }
.ratio-result-box .ratio-label { font-size: 0.75rem; color: #64748b; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.ratio-result-colon { font-size: 2.5rem; font-weight: 700; color: #8b5cf6; user-select: none; }
@media (max-width: 768px) {
.calc-main-grid { grid-template-columns: 1fr; gap: 20px; }
.left-panel, .right-panel { padding: 20px; min-height: auto; }
.dr-calc-wrapper { padding: 0 8px; }
.custom-options { right: 0; left: auto; }
}
@media (min-width: 769px) {
.calculator-hero h1 { font-size: 2.25rem; }
.calculator-hero p { padding: 0; }
.mode-selector { gap: 4px; margin-bottom: 16px; }
.mode-label { padding: 6px 10px; }
.mode-text { font-size: 0.875rem; }
.radio-circle { width: 16px; height: 16px; margin-right: 10px; }
.left-panel, .right-panel { padding: 24px; box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.08); }
}