.calculator-container {
    max-width: 600px;
    margin: 0 auto;
    font-family: 'Noto Sans KR', sans-serif;
    color: #333;
    padding: 10px;
}

.calculator-box {
    background: #fff;
    padding: 25px;
    border: 1px solid #e1e1e1;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
}

.group-title {
    font-size: 1.1em;
    font-weight: bold;
    color: #444;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.divider {
    border: 0;
    border-top: 1px dashed #eee;
    margin: 30px 0;
}

.calc-sentence {
    font-size: 1.15em;
    font-weight: bold;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    margin-bottom: 20px;
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #eee;
}

.sentence-row {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: flex-start;
    flex-wrap: wrap; /* 문장이 길어지면 다음 줄로 */
    line-height: 1.5;
}

.calc-sentence input[type="number"] {
    width: 180px; /* 기본적으로 충분히 넓게 설정 */
    height: 48px; /* 높이 고정: 글자 크기가 작아져도 출렁이지 않음 */
    padding: 8px;
    font-size: 1.15em;
    text-align: right;
    border: 2px solid #ddd;
    border-radius: 6px;
    background: #fff;
    color: #007bff;
    font-weight: bold;
    font-family: monospace;
    transition: border-color 0.2s; /* font-size transition 제거됨 */
    box-sizing: border-box; /* 패딩을 포함한 높이 계산 */
}

/* 1번, 3번의 두 번째 입력 필드 (비율 입력) 폭 1.5배 확대 (110px -> 165px) */
#calc1B, #calc3B {
    width: 165px;
}

.calc-sentence input[type="number"]:focus {
    border-color: #007bff;
    outline: none;
}

/* Chrome, Safari, Edge, Opera */
.calc-sentence input::-webkit-outer-spin-button,
.calc-sentence input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Firefox */
.calc-sentence input[type=number] {
  -moz-appearance: textfield;
}

.calc-result {
    color: #d9534f;
    font-size: 1.25em;
    text-decoration: underline;
    text-underline-offset: 4px;
    word-break: break-all; /* 긴 숫자가 화면을 넘지 않게 조절 */
}

.result-copy-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.9em;
    padding: 4px;
    margin: 0 4px;
    border-radius: 4px;
    transition: background 0.2s;
    vertical-align: middle;
}

.result-copy-btn:hover {
    background: #eef6ff;
}

.result-copy-btn:active {
    transform: scale(0.9);
}

.slider-label {
    font-size: 0.85em;
    color: #666;
    margin-bottom: 5px;
    font-weight: bold;
}

.slider-item {
    margin-bottom: 15px;
}

.slider-control {
    display: flex;
    align-items: center;
    gap: 8px;
}

.adjust-btn {
    background: #f1f3f5;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.4em;
    color: #495057;
    transition: all 0.2s;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    padding: 0;
    line-height: 1;
}

.adjust-btn:active {
    background: #e9ecef;
    transform: scale(0.92);
}

input[type="range"] {
    flex: 1;
    cursor: pointer;
    margin: 0;
}

.knob-outer-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 10px 0;
}

.knob-container {
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f3f5;
    border-radius: 50%;
    border: 2px solid #e1e1e1;
    touch-action: none;
}

.knob {
    width: 70px;
    height: 70px;
    background: linear-gradient(145deg, #ffffff, #e6e6e6);
    border-radius: 50%;
    position: relative;
    cursor: grab;
    box-shadow: 4px 4px 10px #d1d1d1, -4px -4px 10px #ffffff;
    will-change: transform;
}

.knob:active {
    cursor: grabbing;
}

.knob-pointer {
    position: absolute;
    width: 6px;
    height: 18px;
    background: #007bff;
    border-radius: 3px;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
}

.knob-hint {
    font-size: 0.75em;
    color: #999;
    margin-top: 8px;
}

.scale-buttons {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
}

.scale-buttons button {
    height: 36px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1em;
    padding: 0 10px;
    flex: 2;
    transition: background 0.2s;
}

.scale-buttons button:hover { 
    background: #0056b3; 
}

.reset-btn {
    background: #f1f3f5;
    color: #495057;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.reset-btn:hover {
    background: #e9ecef;
}

.scale-buttons .reset-btn {
    flex: 0 0 50px;
    font-size: 1.2em;
}

.share-section {
    display: flex;
    gap: 12px;
    margin-top: 30px;
}

.share-btn {
    flex: 1;
    padding: 14px;
    border: none;
    border-radius: 12px;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
}

.share-btn.primary {
    background: #007bff;
    color: white;
}

.share-btn.primary:hover {
    background: #0056b3;
}

.info-section {
    margin-top: 40px;
    border-top: 1px solid #eee;
    padding-top: 30px;
}

/* Hidden spans for conditional rendering */
.text-prefix:empty {
    display: none;
}