/* electricity-styles.css - 완전 수정 버전 */

:root {
    --primary-color: #0d6efd;
    --primary-hover: #0b5ed7;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fb;
    --bg-tertiary: #f9fafb;
    --text-primary: #333333;
    --text-secondary: #6b7280;
    --text-tertiary: #4b5563;
    --border-primary: #e5e7eb;
    --border-secondary: #d1d5db;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.1);
    --transition-fast: 150ms ease;
    --transition-base: 200ms ease;
    --transition-slow: 300ms ease;
    --global-nav-bg: #1e293b;
    --global-nav-text: #ffffff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    font-size: 16px;
}

/* GPU 가속화 */
.calculator-card, .guide-wrapper, .global-nav {
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

/* 글로벌 네비게이션 수정 */
.global-nav {
    background: var(--global-nav-bg);
    color: var(--global-nav-text);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.global-nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0 1.5rem;
    height: 56px;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 0;
}

.nav-brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--global-nav-text);
    text-decoration: none;
    margin-right: 2rem;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 0;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-menu li {
    position: relative;
}

.nav-menu a {
    color: var(--global-nav-text);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 1rem 1.5rem;
    display: block;
    transition: all var(--transition-base);
    border-left: 1px solid rgba(255,255,255,0.1);
}

.nav-menu li:first-child a {
    border-left: none;
}

.nav-menu a:hover {
    background: rgba(255,255,255,0.1);
}

.nav-menu .active {
    background: rgba(255,255,255,0.15);
    font-weight: 600;
}

.nav-dropdown {
    position: relative;
}

.nav-dropdown-content {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--bg-primary);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    min-width: 200px;
    z-index: 1001;
    display: none;
}

.nav-dropdown:hover .nav-dropdown-content {
    display: block;
}

.nav-dropdown-content a {
    color: var(--text-primary);
    padding: 0.75rem 1rem;
    border: none;
    border-bottom: 1px solid var(--border-primary);
}

.nav-dropdown-content a:hover {
    background: var(--bg-tertiary);
}

.nav-dropdown-content a:last-child {
    border-bottom: none;
}

/* 브레드크럼 */
.breadcrumb {
    background: var(--bg-primary);
    padding: 0.5rem 0;
    font-size: 0.75rem;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-primary);
}

.breadcrumb-container {
    max-width: 1200px;
    margin: 0 auto;
  padding: 0 1.5rem;
}

.breadcrumb a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color var(--transition-base);
}

.breadcrumb a:hover {
    color: var(--primary-color);
}

.breadcrumb-separator {
    margin: 0 0.5rem;
    color: var(--text-secondary);
}

/* 메인 타이틀 섹션 추가 */
.main-title-section {
    background: var(--bg-primary);
    padding: 2.5rem 0;
    border-bottom: 1px solid var(--border-primary);
}

.main-title-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    text-align: center;
}

.main-title {
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0 0 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.title-icon {
    font-size: 2.5rem;
    display: inline-block;
    animation: bounce 2s infinite;
}

.main-subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin: 0;
    font-weight: 500;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* 목차 스타일 */
.table-of-contents {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.toc-container h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
}

.toc-list li {
    display: flex;
}

.toc-list a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-primary);
    border-radius: 6px;
    transition: all var(--transition-base);
    display: block;
    width: 100%;
}

.toc-list a:hover {
    color: var(--primary-color);
    border-color: var(--primary-color);
    background: #f0f7ff;
}

/* 메인 레이아웃 */
.main-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    gap: 2rem;
    padding: 2rem 1.5rem;
}

.calculator-wrapper {
    width: 400px;
    flex-shrink: 0;
    position: sticky;
    top: 80px;
    max-height: calc(100vh - 100px);
}

.calculator-card {
    background: var(--bg-primary);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    height: calc(100vh - 100px);
    display: flex;
    flex-direction: column;
}

/* 계산기 헤더 - 프로필 추가 */
.calculator-header {
    background: var(--bg-primary);
    padding: 1.5rem;
    text-align: center;
    border-bottom: 1px solid var(--border-primary);
}

.calculator-header.compact {
    display: flex;  /* 이게 빠져있었네요! */
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
}
/* 작성자 정보 (왼쪽) */
.author-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.author-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-primary);
    flex-shrink: 0;
}

.author-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    color: #6b7280;
    font-size: 14px;
}

.avatar-fallback.initial {
    background: #3b82f6;
    color: white;
    font-weight: 700;
    font-size: 12px;
}

.author-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* 업데이트 날짜 (오른쪽) */
.update-badge {
    font-size: 0.75rem;
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    padding: 0.375rem 0.75rem;
    border-radius: 20px;
    border: 1px solid var(--border-primary);
    font-weight: 500;
    white-space: nowrap;
    cursor: default;
    transition: all var(--transition-base);
}

.update-badge:hover {
    background: var(--bg-secondary);
    border-color: var(--border-secondary);
}

.calculator-header h2 {
    font-size: 1.375rem;
    font-weight: 700;
    margin: 0;
}

.calculator-body {
    background: var(--bg-primary);
    padding: 1rem;
    overflow-y: auto;
    flex: 1;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--border-secondary) var(--bg-tertiary);
    will-change: scroll-position;
}

.calculator-body::-webkit-scrollbar {
    width: 6px;
}

.calculator-body::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
    border-radius: 3px;
}

.calculator-body::-webkit-scrollbar-thumb {
    background: var(--border-secondary);
    border-radius: 3px;
}

.calculator-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* 탭 스타일 */
.calculator-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    margin-bottom: 1.5rem;
    background: none;
    padding: 0;
    border-bottom: 1px solid var(--border-primary);
}

.tab-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 0.25rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-base);
    position: relative;
    gap: 2px;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.tab-button:hover {
    background: var(--bg-tertiary);
}

.tab-button.active {
    background: none;
}

.tab-button.active .tab-text-top {
    color: var(--primary-color);
    font-weight: 800;
}

.tab-button.active .tab-text-bottom {
    color: var(--primary-color);
}

.tab-button.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary-color);
}

.tab-text-top {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
}

.tab-text-bottom {
    font-size: 0.8125rem;
    font-weight: 400;
    color: var(--text-secondary);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* 폼 스타일 */
.form-row, .form-row-group {
    margin-bottom: 1.25rem;
}

.form-row-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-col {
    display: flex;
    flex-direction: column;
}

label {
    display: block;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

input[data-type="decimal"],
input[data-type="number"],
input[type="text"],
select {
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
    font-weight: 500;
    border: 1px solid var(--border-primary);
    border-radius: 6px;
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: border-color var(--transition-base);
    height: 44px;
    -webkit-appearance: none;
    appearance: none;
    touch-action: manipulation;
}

select {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.7rem center;
    background-size: 1.2em;
    padding-right: 2.5rem;
}

.input-with-unit {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-unit input {
    padding-right: 3.5rem;
}

.unit-inline {
    position: absolute;
    right: 1rem;
    color: var(--text-secondary);
    font-weight: 400;
    pointer-events: none;
}

input:focus, select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.25);
}

.help-text {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
    display: block;
}

.error-message {
    color: var(--danger-color);
    font-size: 0.75rem;
    margin-top: 0.25rem;
    display: block;
}

.auto-calc-info {
    font-size: 0.8125rem;
    color: var(--primary-color);
    margin-top: 0.5rem;
    display: block;
    font-weight: 500;
}

/* 툴팁 */
.tooltip-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    margin-left: 5px;
    background: #e3f2fd;
    color: #1976d2;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-fast);
    -webkit-tap-highlight-color: transparent;
}

.tooltip-icon:hover {
    background: #1976d2;
    color: #fff;
}

.tooltip-content {
    margin-top: 5px;
    padding: 8px 12px;
    background: #f5f5f5;
    border-left: 3px solid #1976d2;
    font-size: 13px;
    color: #666;
    border-radius: 4px;
}

/* 아코디언 */
.accordion-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.accordion-button {
    padding: 0.75rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all var(--transition-base);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    flex: 1;
}

.accordion-button.half-width {
    flex: none;
    width: auto;
    min-width: 200px;
}

.dotted-line {
    flex: 1;
    text-align: center;
    color: var(--border-secondary);
    font-size: 0.875rem;
    overflow: hidden;
    white-space: nowrap;
}

.accordion-button:hover {
    background: var(--bg-secondary);
    border-color: var(--primary-color);
}

.accordion-icon {
    transition: transform var(--transition-base);
    margin-left: 0.5rem;
}

.accordion-content {
    margin-top: 0.75rem;
    padding: 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    border-radius: 6px;
    width: 100%;
}

.discount-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.discount-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.75rem;
    background: #e3f2fd;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
}

.radio-group, .checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.radio-item, .checkbox-item {
    display: flex;
    align-items: center;
    padding: 0.625rem 0.75rem;
    border: 1px solid var(--border-primary);
    border-radius: 6px;
    cursor: pointer;
    transition: all var(--transition-base);
    background: var(--bg-primary);
    -webkit-tap-highlight-color: transparent;
}

.radio-item:hover, .checkbox-item:hover {
    background: #f0f4f8;
    border-color: var(--primary-color);
}

.radio-item input[type="radio"],
.checkbox-item input[type="checkbox"] {
    margin-right: 0.75rem;
    width: 18px;
    height: 18px;
    cursor: pointer;
    flex-shrink: 0;
}

.radio-item input[type="radio"]:checked + span,
.checkbox-item input[type="checkbox"]:checked + span {
    color: var(--primary-color);
    font-weight: 600;
}

/* 헬퍼 박스 */
.link-btn {
    background: none;
    border: none;
    color: var(--primary-color);
    padding: 0.5rem 0;
    font-size: 0.875rem;
    cursor: pointer;
    text-align: left;
    transition: color var(--transition-base);
    -webkit-tap-highlight-color: transparent;
    margin-top: 8px;
    margin-bottom: 15px;
}

.link-btn:hover {
    color: var(--primary-hover);
}

.helper-box {
    margin: 1rem 0;
    padding: 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    border-radius: 6px;
}

.apply-btn {
    margin-top: 0.75rem;
    padding: 0.5rem 1rem;
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background var(--transition-base);
    -webkit-tap-highlight-color: transparent;
}

.apply-btn:hover {
    background: var(--primary-hover);
}

.apply-btn:active {
    transform: scale(0.98);
}

.appliance-checkboxes, .discount-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* 버튼 그리드 */
.button-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    grid-template-areas: 
        "share reset"
        "share calculate";
    gap: 8px;
    margin-top: 1.5rem;
    height: 90px;
}

.button-grid-bottom {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 1.5rem;
}

.button-grid-bottom .share-btn,
.button-grid-bottom .reset-btn {
    grid-area: unset;
}

.btn {
    border: 1px solid var(--border-primary);
    border-radius: 6px;
    background: var(--bg-primary);
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-base);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 500;
    gap: 8px;
    padding: 0.75rem 1rem;
    min-height: 44px;
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.btn:hover {
    border-color: var(--border-secondary);
    background: var(--bg-tertiary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

.btn svg {
    width: 16px;
    height: 16px;
}

.share-btn {
    grid-area: share;
    background: #fff7ed;
    border-color: #fed7aa;
    color: #ea580c;
}

.share-btn:hover {
    background: #ffedd5;
    border-color: #fdba74;
}

.calculate-btn {
    grid-area: calculate;
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
    font-weight: 600;
}

.calculate-btn:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
}

.reset-btn {
    grid-area: reset;
}

/* 결과 영역 */
.result-container {
    margin-top: 1rem;
}

.result-card {
    background: var(--bg-tertiary);
    border-radius: 12px;
    padding: 1rem;
    border: 1px solid var(--border-primary);
    margin-bottom: 0.75rem;
}

.result-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    text-align: center;
    color: var(--text-primary);
}

.result-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* 결과 스타일 */
.result-total-top {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #fff;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    margin-bottom: 10px;
    position: relative;
}

.total-label {
    display: block;
    font-size: 0.875rem;
    opacity: 0.9;
    margin-bottom: 8px;
}

.total-amount {
    display: block;
    font-size: 2rem;
    font-weight: 700;
}

.discount-applied {
    display: block;
    font-size: 1rem;
    margin-top: 10px;
    font-weight: 600;
    color: #ffeb3b;
}

.result-details {
    margin-top: 0;
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-primary);
}

.result-item:last-child {
    border-bottom: none;
}

.result-item.primary {
    font-size: 1rem;
    font-weight: 500;
    padding: 12px 0;
}

.result-subitems {
    background: #f9fafb;
    padding: 10px 20px;
    margin-bottom: 15px;
    border-left: 3px solid #e5e7eb;
}

.subitem {
    display: flex;
    justify-content: space-between;
    font-size: 0.8125rem;
    color: #666;
    padding: 4px 0;
}

.subitem span:first-child {
    font-size: 0.75rem;
}

.result-item.highlight {
    background: #e3f2fd;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 1.125rem;
    font-weight: 700;
    border: none;
    position: relative;
}

.result-item.highlight .value {
    color: #1976d2;
    font-size: 1.5rem;
}

.result-comparison {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.comparison-item {
    text-align: center;
    padding: 10px;
    background: #f5f5f5;
    border-radius: 8px;
}

.comparison-item .label {
    display: block;
    font-size: 0.8125rem;
    color: #666;
    margin-bottom: 5px;
}

.comparison-item .value {
    display: block;
    font-size: 1.125rem;
    font-weight: 700;
    color: #333;
}

/* 누진제 관련 스타일 */
.season-info-small {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 1rem;
    font-weight: 500;
}

.progressive-warning {
    background: #fef3c7;
    border: 1px solid #fbbf24;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    text-align: center;
}

.progressive-warning.danger {
    background: #fee2e2;
    border-color: #ef4444;
    color: #dc2626;
}

.progressive-warning.safe {
    background: #d1fae5;
    border-color: #10b981;
    color: #059669;
}

.progressive-warning.warning {
    background: #fef3c7;
    border-color: #fbbf24;
    color: #d97706;
}

.progressive-bar-wrapper {
    margin: 1.5rem 0;
}

.progressive-bar-wrapper h4 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.progressive-bar-container {
    margin: 1rem 0;
    position: relative;
    padding-bottom: 45px;
}

.bar-wrapper {
    height: 60px;
    border-radius: 8px;
    overflow: visible;
    position: relative;
    display: flex;
    box-shadow: var(--shadow-sm);
}

.bar-section {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-size: 0.75rem;
    color: #fff;
    font-weight: 600;
    position: relative;
}

.bar-section span {
    line-height: 1.2;
}

.stage-limit {
    font-size: 0.6875rem;
    opacity: 0.9;
}

.stage1 {
    background: #10b981;
}

.stage2 {
    background: #f59e0b;
}

.stage3 {
    background: #ef4444;
}

.usage-indicator {
    position: absolute;
    top: -30px;
    height: 100px;
    transition: left 0.3s;
}

.indicator-line {
    width: 3px;
    height: 100%;
    background: #000;
    margin: 0 auto;
}

.indicator-label {
    position: absolute;
    top: -5px;
    left: 50%;
    transform: translateX(-50%);
    background: #000;
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 700;
    white-space: nowrap;
}

.indicator-label::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 4px solid #000;
}

.bar-scale {
    position: absolute;
    bottom: -25px;
    left: 0;
    right: 0;
    height: 20px;
    display: flex;
    align-items: flex-start;
}

.scale-mark {
    position: absolute;
    font-size: 0.75rem;
    color: #666;
    font-weight: 500;
    transform: translateX(-50%);
}

.scale-mark:last-child {
    transform: none;
}

.progressive-info-text {
    text-align: center;
    margin-top: 10px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.progressive-info-text.danger {
    color: var(--danger-color);
}

.progressive-info-text.warning {
    color: var(--warning-color);
}

.overflow-info {
    margin-top: 0.75rem;
    text-align: center;
    font-size: 0.875rem;
    font-weight: 600;
}

.overflow-info.danger {
    color: var(--danger-color);
}

.overflow-info.warning {
    color: var(--warning-color);
}

.appliance-guide {
    background: #f0f9ff;
    border: 1px solid #3b82f6;
    border-radius: 8px;
    padding: 1.25rem;
    margin: 1rem 0;
}

.appliance-guide h4 {
    font-size: 1rem;
    color: #1e40af;
    margin-bottom: 0.75rem;
}

.appliance-guide ul {
    list-style: none;
    padding: 0;
}

.appliance-guide li {
    padding: 0.375rem 0;
    font-size: 0.9rem;
}

/* 가이드 영역 */
.guide-wrapper {
    flex: 1;
    background: var(--bg-primary);
    border-radius: 16px;
    padding: 2.5rem;
    box-shadow: var(--shadow-md);
    min-height: 400px;
    min-width: 0;
    will-change: scroll-position;
}

.guide-content > h2 {
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.guide-section {
    margin-bottom: 2.5rem;
}

.guide-section h3 {
    font-size: 1.125rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-weight: 600;
}

.guide-section h4 {
    font-size: 1rem;
    margin: 1.5rem 0 0.75rem;
    color: var(--text-primary);
    font-weight: 600;
}

.guide-section h5 {
    font-size: 0.9375rem;
    margin: 1rem 0 0.5rem;
    color: var(--text-primary);
    font-weight: 500;
}

.usage-scenarios {
    background: var(--bg-tertiary);
    border-radius: 12px;
    padding: 1.5rem;
}

.scenario {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-primary);
}

.scenario:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.scenario h5 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 0.9375rem;
}

.scenario p {
    font-size: 0.875rem;
    line-height: 1.8;
    color: var(--text-secondary);
}

.scenario a {
    color: var(--primary-color);
    text-decoration: none;
}

.scenario a:hover {
    text-decoration: underline;
}

.tip-section, .discount-section {
    margin-bottom: 2rem;
}

.tip-card, .discount-card {
    background: var(--bg-tertiary);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid var(--border-primary);
}

.tip-card h4, .discount-card h4 {
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.tip-list {
    list-style: none;
    padding: 0;
}

.tip-list li {
    padding: 0.5rem 0 0.5rem 1.5rem;
    position: relative;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.tip-list li::before {
    content: "💡";
    position: absolute;
    left: 0;
}

.discount-table {
    width: 100%;
    margin-bottom: 1rem;
}

.discount-table td {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-primary);
}

.discount-table td:last-child {
    text-align: right;
    color: var(--primary-color);
    font-weight: 600;
}

.discount-table tr:last-child td {
    border-bottom: none;
}

/* 구분선 */
.divider {
    margin: 30px 0 20px;
    position: relative;
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--border-primary);
}

.divider-content {
    background: var(--bg-primary);
    border: 1px solid var(--border-primary);
    border-radius: 6px;
    padding: 8px 16px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-base);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: var(--shadow-sm);
    position: relative;
    z-index: 1;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.divider-content:hover {
    border-color: var(--primary-color);
    background: var(--bg-tertiary);
}

.arrow-icon {
    transition: transform var(--transition-base);
}

.divider-content.expanded .arrow-icon {
    transform: rotate(180deg);
}

.detail-section {
    overflow: hidden;
    transition: 0.3s ease-in-out;
}

.guide-detail {
    background: var(--bg-primary);
    border-radius: 12px;
    padding: 2rem;
    margin-top: 1rem;
}

.comparison-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-primary);
    overflow: hidden;
    margin: 1rem 0;
    font-size: 0.9rem;
}

.comparison-table th,
.comparison-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border-primary);
}

.comparison-table th {
    background: var(--bg-tertiary);
    font-weight: 600;
}

/* FAQ */
.faq-section {
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-primary);
}

.faq-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.faq-item {
    background: var(--bg-tertiary);
    border-radius: 8px;
    border: 1px solid var(--border-primary);
    overflow: hidden;
    transition: all var(--transition-base);
}

.faq-question {
    width: 100%;
    padding: 1rem 1.25rem;
    background: transparent;
    border: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: left;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    transition: background var(--transition-base);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.faq-question:hover {
    background: var(--bg-secondary);
}

.faq-icon {
    font-size: 1.25rem;
    transition: transform var(--transition-base);
    flex-shrink: 0;
    margin-left: 1rem;
}

.faq-question.active .faq-icon {
    transform: rotate(45deg);
}

.faq-answer {
    padding: 0 1.25rem;
    max-height: 0;
    overflow: hidden;
    transition: all var(--transition-slow);
    background: var(--bg-primary);
}

.faq-answer.active {
    padding: 1rem 1.25rem 1.25rem;
    max-height: 500px;
}

.faq-answer p {
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

/* 공유 모달 */
.share-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.share-modal-content {
    background: var(--bg-primary);
    border-radius: 12px;
    padding: 0;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.share-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-primary);
}

.share-modal-header h3 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all var(--transition-base);
}

.close-modal:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.share-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    padding: 1.5rem;
}

.share-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem;
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    background: var(--bg-primary);
    font-size: 0.875rem;
    color: var(--text-primary);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-base);
    font-family: inherit;
}

.share-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.share-button svg {
    width: 1.5rem;
    height: 1.5rem;
}

.share-button.facebook {
    border-color: #1877f2;
    color: #1877f2;
}

.share-button.facebook:hover {
    background: #1877f2;
    color: #fff;
}

.share-button.facebook svg {
    fill: #1877f2;
}

.share-button.facebook:hover svg {
    fill: white;
}

.share-button.twitter {
    border-color: #000;
    color: #000;
}

.share-button.twitter:hover {
    background: #000;
    color: #fff;
}

.share-button.twitter svg {
    fill: #000;
}

.share-button.twitter:hover svg {
    fill: white;
}

.share-button.kakao {
    border-color: #fee500;
    color: #3a1d1d;
}

.share-button.kakao:hover {
    background: #fee500;
}

.share-button.kakao svg {
    fill: #3a1d1d;
}

.share-button.naver {
    border-color: #03c75a;
    color: #03c75a;
}

.share-button.naver:hover {
    background: #03c75a;
    color: #fff;
}

.share-button.naver svg {
    fill: #03c75a;
}

.share-button.naver:hover svg {
    fill: white;
}

.share-button.copy-link {
    grid-column: 1 / -1;
    flex-direction: row;
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.share-button.copy-link:hover {
    background: var(--primary-color);
    color: #fff;
}

.share-button.copy-link svg {
    stroke: var(--primary-color);
}

.share-button.copy-link:hover svg {
    stroke: white;
}

.mobile-menu-btn {
    display: none;
}

@media (max-width: 768px) {
    .mobile-menu-btn {
        display: block !important;
        background: none;
        border: none;
        color: var(--global-nav-text);
        font-size: 1.5rem;
        padding: 0.75rem 0.75rem 0.75rem 0.5rem;  
        margin-right: 0.5rem;
        margin-left: 0;  /* 추가 */        cursor: pointer;
        user-select: none;  /* 추가 */
        min-width: 44px;  /* 추가 */
        min-height: 44px;  /* 추가 */
        -webkit-tap-highlight-color: transparent;  /* 추가 */
        -webkit-user-select: none;  /* 추가 */
        touch-action: manipulation;  /* 추가 */
    }


    .mobile-menu {
        position: fixed;
        top: 0;
        left: -280px;
        width: 280px;
        height: 100vh;
        background: var(--bg-primary);
        box-shadow: 2px 0 10px rgba(0,0,0,0.1);
        transition: left 0.3s ease;
        z-index: 1100;
        overflow-y: auto;
    }

    .mobile-menu.active {
        left: 0;
    }
.mobile-menu-btn,
.mobile-menu-close,
.mobile-menu-overlay {
    -webkit-tap-highlight-color: transparent;
}
    .mobile-menu-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5);
        z-index: 1050;
    }

    .mobile-menu-overlay.active {
        display: block;
    }
    .nav-brand {
        margin-right: auto;  
    }

    /* 모바일 메뉴 헤더 스타일 추가 */
    .mobile-menu-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 1rem 1.5rem;
        border-bottom: 1px solid var(--border-primary);
        background: var(--bg-primary);
    }

    .mobile-menu-header h3 {
        margin: 0;
        font-size: 1.125rem;
        color: var(--text-primary);
    }

    .mobile-menu-header button {
        background: none;
        border: none;
        font-size: 1.5rem;
        color: var(--text-secondary);
        cursor: pointer;
        width: 32px;
        height: 32px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* 모바일 메뉴 리스트 */
    .mobile-menu-list {
        list-style: none;
        padding: 0;
        margin: 0;
    }

    .mobile-menu-list > li {
        border-bottom: 1px solid var(--border-primary);
    }

    .mobile-menu-list > li > a {
        display: block;
        padding: 1rem 1.5rem;
        color: var(--text-primary);
        text-decoration: none;
        font-weight: 500;
        transition: background var(--transition-base);
    }

    .mobile-menu-list > li > a:hover {
        background: var(--bg-tertiary);
    }

    .mobile-menu-list > li.active > a {
        color: var(--primary-color);
        background: #f0f7ff;
    }

    /* 서브메뉴 */
    .mobile-menu-list ul {
        list-style: none;
        padding: 0;
        margin: 0;
        background: var(--bg-tertiary);
    }

    .mobile-menu-list ul li {
        border-top: 1px solid var(--border-primary);
    }

    .mobile-menu-list ul a {
        display: block;
        padding: 0.75rem 2.5rem;
        color: var(--text-secondary);
        text-decoration: none;
        font-size: 0.875rem;
        transition: all var(--transition-base);
    }

    .mobile-menu-list ul a:hover {
        color: var(--primary-color);
        background: var(--bg-primary);
    }

    .nav-menu {
        display: none;
    }

    body {
        font-size: 16px !important;
        -webkit-text-size-adjust: 100%;
    }

    .global-nav-container {
        padding: 0 1rem 0 0.5rem;  /* 왼쪽 패딩만 0.5rem으로 줄임 */
    }

    .nav-brand {
        font-size: 1.125rem;
        margin-right: 1rem;
    }

    .breadcrumb-container {
        padding: 0 1rem;
    }

    /* 메인 타이틀 모바일 */
    .main-title-section {
        padding: 1.5rem 0;
    }
    
    .main-title {
        font-size: 1.75rem;
        flex-direction: row;
        gap: 0.5rem;
        flex-wrap: nowrap;
    }
    
    .title-icon {
        font-size: 1.5rem;
        flex-shrink: 0;
    }
    
    .main-subtitle {
        font-size: 0.9375rem;
        padding: 0 1rem;
        line-height: 1.6;
    }

    /* 계산기 헤더 - 모바일 세로 배치 */
    .calculator-header.compact {
        display: flex;  /* 추가 */
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 0.5rem;
        padding: 0.75rem;
    }

    .author-info {
        order: 1;
    }
    
    .update-badge {
        order: 2;
        font-size: 0.6875rem;
        padding: 0.25rem 0.5rem;
    }
    
    .author-avatar {
        width: 24px;
        height: 24px;
    }
    
    .author-name {
        font-size: 0.8125rem;
    }

    .main-wrapper {
        flex-direction: column;
        padding: 0;
        gap: 0;
    }

    .calculator-wrapper {
        width: 100%;
        position: relative;
        top: 0;
        max-height: none;
        margin-bottom: 2rem;
    }

    .calculator-card {
        height: auto;
        border-radius: 0;
        box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    }

    .calculator-header h2 {
        font-size: 1.25rem;
    }

    .calculator-body {
        padding: 1rem;
        overflow-y: visible;
        -webkit-overflow-scrolling: touch;
    }

    .guide-wrapper {
        border-radius: 0;
        padding: 1.5rem;
        margin-top: 0;
        border-top: 8px solid var(--bg-secondary);
    }

    .table-of-contents {
        margin: 0 0 1.5rem;
    }

    .toc-list {
        grid-template-columns: 1fr;
    }

    /* 모바일 폼 간격 통일 */
    .form-row, .form-row-group {
        margin-bottom: 1.25rem !important;
    }

    .form-row-group {
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }

    /* 모바일 레이블 크기 통일 */
    label {
        font-size: 0.875rem !important;
    }

    /* 모바일 입력 요소 */
    input, select {
        font-size: 16px !important;
        height: 44px;
        min-height: 44px;
    }

    .unit-inline {
        font-size: 0.875rem;
    }

    .tab-button {
        padding: 0.625rem 0.125rem;
    }

    .tab-text-top {
        font-size: 1rem;
    }

    .tab-text-bottom {
        font-size: 0.75rem;
    }

    .calculator-tabs {
        margin-bottom: 1rem;
    }

    .accordion-button.half-width {
        min-width: 150px;
        font-size: 0.8125rem;
        padding: 0.625rem 0.75rem;
    }

    .dotted-line {
        display: none;
    }

    .button-grid {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto auto;
        grid-template-areas: 
            "share reset"
            "calculate calculate";
        gap: 0.5rem;
        margin-top: 1rem;
        height: auto;
    }

    .button-grid-bottom {
        gap: 0.5rem;
        margin-top: 1rem;
    }

    .btn {
        font-size: 0.8125rem;
        padding: 0.625rem 0.5rem;
        min-height: 40px;
    }

    .btn svg {
        width: 14px;
        height: 14px;
    }

    .total-amount {
        font-size: 1.75rem;
    }

    .discount-applied {
        font-size: 0.875rem;
    }

    .result-card {
        padding: 0.875rem;
    }

    .result-card h3 {
        font-size: 1.125rem;
    }

    .result-item {
        padding: 0.375rem 0;
        font-size: 0.875rem;
    }

    .result-item.primary {
        font-size: 0.9375rem;
        padding: 0.75rem 0;
    }

    .result-subitems {
        padding: 0.75rem 1rem;
    }

    .subitem {
        font-size: 0.75rem;
    }

    .result-item.highlight {
        padding: 0.75rem;
        font-size: 1rem;
    }

    .result-item.highlight .value {
        font-size: 1.25rem;
    }

    .bar-wrapper {
        height: 50px;
    }

    .bar-section {
        font-size: 0.625rem;
    }

    .stage-limit {
        font-size: 0.5625rem;
    }

    .usage-indicator {
        top: -25px;
        height: 85px;
    }

    .indicator-label {
        font-size: 0.75rem;
        padding: 3px 6px;
    }

    .bar-scale {
        bottom: -20px;
    }

    .scale-mark {
        font-size: 0.625rem;
    }

    .progressive-info-text {
        font-size: 0.875rem;
    }

    .overflow-info {
        font-size: 0.75rem;
    }

    .progressive-bar-wrapper h4 {
        font-size: 0.875rem;
        margin-bottom: 0.5rem;
    }

    .appliance-guide {
        padding: 1rem;
        margin: 0.75rem 0;
    }

    .appliance-guide h4 {
        font-size: 0.875rem;
    }

    .appliance-guide li {
        font-size: 0.8125rem;
    }

    .guide-content > h2 {
        font-size: 1.5rem;
    }

    .guide-section {
        margin-bottom: 2rem;
    }

    .guide-section h3 {
        font-size: 1.125rem;
    }

    .guide-section h4 {
        font-size: 1rem;
        margin: 1.25rem 0 0.75rem;
    }

    .guide-section h5 {
        font-size: 0.9375rem;
    }

    .usage-scenarios,
    .tip-card,
    .discount-card {
        padding: 1rem;
    }

    .scenario {
        margin-bottom: 1.25rem;
        padding-bottom: 1.25rem;
    }

    .scenario h5 {
        font-size: 0.875rem;
    }

    .scenario p {
        font-size: 0.8125rem;
        line-height: 1.8;
    }

    .tip-section, .discount-section {
        margin-bottom: 1.5rem;
    }

    .tip-list li {
        font-size: 0.8125rem;
    }

    .discount-table {
        font-size: 0.8125rem;
    }

    .divider {
        margin: 1.5rem 0 1rem;
    }

    .divider-content {
        font-size: 0.8125rem;
        padding: 0.625rem 1rem;
    }

    .guide-detail {
        padding: 1rem;
    }

    .comparison-table {
        font-size: 0.75rem;
    }

    .comparison-table th,
    .comparison-table td {
        padding: 0.5rem 0.375rem;
    }

    .faq-section {
        margin-top: 2rem;
        padding-top: 1.5rem;
    }

    .faq-item {
        margin-bottom: 0.5rem;
    }

    .faq-question {
        padding: 0.875rem 1rem;
        font-size: 0.875rem;
    }

    .faq-icon {
        font-size: 1rem;
    }

    .faq-answer {
        font-size: 0.8125rem;
    }

    .faq-answer.active {
        padding: 0.75rem 1rem 1rem;
    }

    .share-modal-content {
        max-width: 350px;
    }

    .share-buttons {
        grid-template-columns: 1fr 1fr;
        gap: 0.625rem;
        padding: 1.25rem;
    }

    .share-button {
        padding: 0.75rem;
        font-size: 0.75rem;
    }

    .share-button svg {
        width: 1.25rem;
        height: 1.25rem;
    }

    /* 터치 최적화 */
    .btn, .tab-button, input, select, .faq-question {
        min-height: 44px;
        min-width: 44px;
    }

    /* iOS 줌 방지 */
    input[type="email"],
    input[type="number"],
    input[type="tel"],
    input[type="text"],
    select,
    textarea {
        font-size: 16px !important;
    }
}

/* 태블릿 대응 */
@media (min-width: 769px) and (max-width: 1024px) {
    .main-wrapper {
        flex-direction: column;
        max-width: 768px;
    }

    .main-title {
        font-size: 1.875rem;
    }
    
    .main-subtitle {
        font-size: 1rem;
    }

    .calculator-wrapper {
        width: 100%;
        position: relative;
        top: 0;
        max-height: none;
        margin-bottom: 2rem;
    }

    .calculator-card {
        height: auto;
    }

    .guide-wrapper {
        width: 100%;
    }
}

/* 접근성 개선 */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0s !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0s !important;
    }
}

@media (prefers-contrast: high) {
    .btn {
        border-width: 2px;
    }
    
    input:focus, select:focus {
        outline: 3px solid var(--primary-color);
        outline-offset: 2px;
    }
}

/* 인쇄 스타일 */
@media print {
    .global-nav,
    .breadcrumb,
    .main-title-section,
    .table-of-contents,
    .btn,
    .button-grid,
    .button-grid-bottom,
    .divider-content,
    .faq-section {
        display: none !important;
    }
    
    .calculator-card,
    .guide-wrapper {
        box-shadow: none !important;
        page-break-inside: avoid;
    }
    
    .result-container {
        page-break-inside: avoid;
    }
}