/* 섹션 스켈레톤 레이아웃 */
.news-skeleton-card {
  background: linear-gradient(135deg, #FFFBF0 0%, #FFF3E0 100%);
  border: 1px solid rgba(255,107,53,.2);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 8px;
  box-shadow: 0 2px 8px rgba(255,107,53,.08);
}
.news-skeleton-title { height: 14px; width: 60%; background: rgba(255,107,53,.15); border-radius: 8px; margin-bottom: 12px; animation: pulse 1.4s ease-in-out infinite; }
.news-skeleton-line { height: 10px; width: 100%; background: rgba(0,0,0,.06); border-radius: 8px; margin-bottom: 8px; animation: pulse 1.4s ease-in-out infinite; }
.news-skeleton-line.short { width: 70%; }
/* 전체 페이지 로딩 오버레이 */
.app-loading-overlay {
  position: fixed; left: 0; top: 0; right: 0; bottom: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(255,240,225,0.96));
  z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  flex-direction: column;
  pointer-events: all;
}
.app-loading-overlay.hidden { opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .25s ease; }
.app-loading-overlay .news-fly-loader { margin-top: 12px; }
.app-loading-title {
  color: #222; font-weight: 800; font-size: 22px; margin-bottom: 10px; letter-spacing: -0.3px;
}
.app-loading-sub { font-size: 14px; color: #666; }

/* 인라인 로딩 배너 (화면 상단 고정 X, 컨테이너 상단에만 표시) */
.app-inline-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 8px;
  margin-bottom: 8px;
  border: 1px solid rgba(255, 107, 53, 0.2);
  background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(255, 245, 235, 0.9));
  border-radius: 10px;
}
.app-inline-loading.hidden { opacity: 0; visibility: hidden; transition: opacity .25s ease; }
.app-inline-loading .app-loading-title { font-size: 14px; font-weight: 800; }
.inline-progress {
  width: 100%;
  max-width: 360px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 107, 53, 0.15);
  overflow: hidden;
}
.inline-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #FF6B35, #FF8C00);
  transition: width .25s ease;
}
.inline-progress-text { font-size: 11px; color: #ff7a00; font-weight: 700; }
/* 뉴스 섹션 로딩 애니메이션 - 신문이 날아다니는 느낌 */
.news-fly-loader {
  position: relative;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 800px;
}
.news-fly-paper {
  width: 72px;
  height: 48px;
  background: linear-gradient(135deg, #fff, #f5f5f5);
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  transform-style: preserve-3d;
  animation: flyPaper 1.6s ease-in-out infinite, tilt 1.2s ease-in-out infinite alternate;
}
@keyframes tilt { from { transform: rotateX(6deg) rotateZ(-2deg);} to { transform: rotateX(-6deg) rotateZ(2deg);} }
.news-fly-paper::before, .news-fly-paper::after {
  content: '';
  position: absolute;
  left: 6px; right: 6px;
  height: 3px;
  background: #e6e6e6;
  border-radius: 2px;
}
.news-fly-paper::before { top: 10px; }
.news-fly-paper::after  { top: 24px; }
@keyframes flyPaper {
  0%   { transform: translate3d(-60px,0,0) rotateY(-35deg) rotateZ(-8deg); opacity: .5; }
  50%  { transform: translate3d(0,-6px,20px) rotateY(0) rotateZ(0); opacity: 1; }
  100% { transform: translate3d(60px,0,0) rotateY(35deg) rotateZ(8deg); opacity: .5; }
}
.news-fly-caption {
  position: absolute;
  bottom: 8px;
  left: 0; right: 0;
  text-align: center;
  color: #ff7a00;
  font-size: 12px;
}
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', 'Noto Sans KR', sans-serif;
    background: linear-gradient(135deg, #FFF8E1 0%, #FFE0B2 50%, #FFCC80 100%);
    color: #333;
    line-height: 1.4;
    padding: 15px;
    min-height: 100vh;
    width: 100%;
    overflow-x: hidden;
    /* iOS Safari 최적화 */
    -webkit-overflow-scrolling: touch;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    /* iOS Safari 스크롤 최적화 */
    overscroll-behavior: none;
    -webkit-overflow-scrolling: touch;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 18px;
    padding: 15px;
    box-shadow: 0 12px 30px rgba(255, 107, 53, 0.1);
    border: 2px solid rgba(255, 107, 53, 0.2);
    width: 100%;
    box-sizing: border-box;
    /* 이미지 저장 시 여백 제거 */
    overflow: hidden;
}

.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    border-bottom: 3px solid #FF6B35;
    padding: 12px 15px;
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.1) 0%, rgba(255, 140, 0, 0.1) 100%);
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.2);
    position: relative;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.title-section {
    display: flex;
    flex-direction: column;
    gap: 2px;
    align-items: flex-start;
}

.logo {
    max-height: 75px;
    width: auto;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(255, 107, 53, 0.3);
}

.title,
h1 {
    font-size: 28px;
    font-weight: bold;
    color: #FF6B35;
    text-shadow: 0 2px 4px rgba(255, 107, 53, 0.3);
    letter-spacing: 2px;
    margin: 0;
    position: relative;
    z-index: 1;
}

h2 {
    font-size: 13px;
    font-weight: bold;
    color: white;
    margin: 0;
}

h3 {
    font-size: 13px;
    color: #FF6B35;
    font-weight: bold;
    text-align: center;
    text-shadow: 0 1px 2px rgba(255, 107, 53, 0.2);
    margin: 0;
}

.update-time {
    font-size: 13px;
    color: #FF6B35;
    background: rgba(255, 107, 53, 0.1);
    padding: 8px 15px;
    border-radius: 20px;
}

.update-time-container {
    text-align: center;
    margin-bottom: 15px;
    padding: 0 20px;
}

.update-time-small {
    font-size: 11px;
    color: #FF6B35;
    background: rgba(255, 107, 53, 0.08);
    padding: 6px 12px;
    border-radius: 15px;
    display: inline-block;
    font-weight: 500;
    opacity: 0.9;
}

.update-time:hover {
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.25) 0%, rgba(255, 140, 0, 0.25) 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.3);
}

.news-section {
    margin-bottom: 8px;
}

.category-header {
    background: linear-gradient(90deg, #FF6B35, #FF8C00);
    color: white;
    padding: 6px 12px;
    margin-bottom: 6px;
    font-weight: bold;
    font-size: 13px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 10px rgba(255, 107, 53, 0.3);
}

.category-title-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.category-icon {
    font-size: 20px;
}

/* 기존 뉴스 스타일 유지 */
.news-item {
    background: linear-gradient(135deg, #FFFBF0 0%, #FFF3E0 100%);
    margin-bottom: 10px;
    padding: 15px 18px;
    border-left: 5px solid #FF6B35;
    border-radius: 12px;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid rgba(255, 107, 53, 0.2);
}

.news-item:hover {
    background: linear-gradient(135deg, #FFF8E1 0%, #FFE0B2 100%);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 107, 53, 0.2);
    border-left-width: 8px;
}

/* 새로운 간결한 뉴스 스타일 */
.news-item-compact {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    padding: 4px 8px;
    margin-bottom: 3px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 6px;
    transition: all 0.2s ease;
    cursor: pointer;
    border: 1px solid rgba(255, 107, 53, 0.1);
}

.news-item-compact:hover {
    background: rgba(255, 107, 53, 0.05);
    transform: translateX(2px);
    border-color: rgba(255, 107, 53, 0.3);
}

.news-bullet {
    color: #FF6B35;
    font-weight: bold;
    font-size: 14px;
    margin-top: 1px;
}

.news-content {
    flex: 1;
}

.news-footer-compact {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 3px;
    position: relative;
}

.news-source-right {
    color: #FF6B35;
    font-weight: 700;
    font-size: 11px;
}

.news-title-compact {
    font-size: 14px;
    font-weight: bold;
    color: #333;
    line-height: 1.2;
    margin-bottom: 2px;
}

.news-desc-compact {
    font-size: 12px;
    color: #666;
    line-height: 1.3;
}

.news-source-compact {
    background: #FF6B35;
    color: white;
    padding: 1px 5px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 9px;
}

.news-time-compact {
    color: #888;
    font-style: italic;
    font-size: 9px;
}

/* 기존 스타일들 */
.news-title {
    font-size: 15px;
    font-weight: bold;
    color: #FF6B35;
    margin-bottom: 8px;
}

.news-description {
    font-size: 12px;
    color: #555;
    line-height: 1.4;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-meta {
    font-size: 11px;
    color: #888;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.news-source {
    background: #FF6B35;
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: bold;
}

.news-time {
    font-style: italic;
}

.bottom-section {
    display: grid;
    grid-template-columns: 0.4fr 0.6fr;
    gap: 8px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 2px solid rgba(255, 107, 53, 0.2);
    margin-bottom: 0px;
}

.weather-section,
.rates-section {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 8px;
    padding: 12px;
    border: 1px solid rgba(255, 107, 53, 0.2);
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    min-height: 120px;
    margin-bottom: 0px;
    box-shadow: 0 2px 8px rgba(255, 107, 53, 0.08);
    transition: all 0.3s ease;
}

.weather-section {
    padding: 8px;
}

.weather-section:hover,
.rates-section:hover {
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.12);
    transform: translateY(-1px);
}

.section-title {
    font-size: 14px;
    font-weight: 700;
    color: #FF6B35;
    margin-bottom: 8px;
    text-align: center;
    padding-bottom: 6px;
    border-bottom: 2px solid rgba(255, 107, 53, 0.3);
    text-shadow: 0 1px 2px rgba(255, 107, 53, 0.2);
}

.weather-grid {
    display: block;
    margin-bottom: 2px;
}

/* 간결한 날씨 카드 (모바일 최적화) */
.weather-card {
    margin-bottom: 6px;
    padding: 8px;
    background: rgba(255, 107, 53, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(255, 107, 53, 0.15);
}

.weather-card-main {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 6px;
}

.weather-left {
    display: grid;
    grid-template-columns: 28px 1fr;
    align-items: center;
    column-gap: 8px;
}

.weather-emoji {
    font-size: 1.4rem;
    line-height: 1;
}

.weather-main-text {
    display: grid;
    grid-template-rows: auto auto;
    row-gap: 2px;
}

/* 위치 텍스트 제거됨 */

.weather-temp {
    font-size: 1.25rem;
    font-weight: 700;
    color: #333;
    line-height: 1.1;
}

.weather-desc-text {
    font-size: 0.72rem;
    color: #666;
    line-height: 1.1;
    white-space: nowrap;
}

.weather-right {
    text-align: right;
    font-size: 0.72rem;
    color: #666;
    line-height: 1.2;
}

.weather-hi-lo {
    font-weight: 700;
    color: #FF6B35;
    margin-bottom: 2px;
}

@media (max-width: 480px) {
    .weather-card { padding: 6px; }
    .weather-left { grid-template-columns: 24px 1fr; column-gap: 6px; }
    .weather-emoji { font-size: 1.1rem; }
    .weather-temp { font-size: 1.1rem; }
    .weather-desc-text { font-size: 0.66rem; }
    .weather-right { font-size: 0.66rem; }
}

/* 시간대별 날씨 스타일 */
.hourly-weather {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 2px;
}

.weather-hour-item {
    text-align: center;
    background: rgba(255, 255, 255, 0.7);
    padding: 2px 1px;
    border-radius: 4px;
    border: 1px solid rgba(255, 107, 53, 0.2);
    transition: all 0.2s ease;
}

.weather-hour-item:hover {
    background: rgba(255, 107, 53, 0.1);
    transform: translateY(-1px);
}

.weather-hour-time {
    font-size: 8px;
    color: #FF6B35;
    font-weight: bold;
    margin-bottom: 2px;
}

.weather-hour-icon {
    font-size: 12px;
    margin-bottom: 2px;
}

.weather-hour-temp {
    font-size: 10px;
    font-weight: bold;
    color: #333;
    margin-bottom: 0;
}

.weather-hour-rain {
    font-size: 8px;
    color: #666;
}

/* PC용 날씨 아이템 스타일 */
@media (min-width: 769px) {
    .hourly-weather {
        grid-template-columns: repeat(6, 1fr);
        gap: 4px;
    }

    .weather-hour-item {
        padding: 6px 4px;
    }

    .weather-hour-time {
        font-size: 10px;
        margin-bottom: 3px;
    }

    .weather-hour-icon {
        font-size: 16px;
        margin-bottom: 3px;
    }

    .weather-hour-temp {
        font-size: 12px;
        margin-bottom: 2px;
    }

    .weather-hour-rain {
        font-size: 9px;
    }
}

.current-weather-summary {
    background: rgba(255, 107, 53, 0.05);
    border: 1px solid rgba(255, 107, 53, 0.2);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
}

.current-weather-summary .sunrise-sunset {
    font-size: 0.8rem;
    color: #666;
    text-align: right;
}

.weather-item {
    text-align: center;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    padding: 8px 6px;
    border-radius: 6px;
    border: 1px solid rgba(255, 107, 53, 0.15);
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(255, 107, 53, 0.08);
}

.weather-item:hover {
    background: linear-gradient(135deg, #ffffff 0%, #fff3e0 100%);
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(255, 107, 53, 0.12);
    border-color: #FF6B35;
}

.weather-time {
    font-size: 10px;
    color: #FF6B35;
    font-weight: bold;
    margin-bottom: 4px;
}

.temperature {
    font-size: 13px;
    font-weight: bold;
    color: #333;
    margin-bottom: 4px;
}

.weather-icon {
    font-size: 16px;
}

.weather-desc {
    font-size: 10px;
    color: #666;
    margin-top: 2px;
    text-align: center;
}

.rates-table {
    font-size: 13px;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.rate-row {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 107, 53, 0.2);
    visibility: visible !important;
    opacity: 1 !important;
}

.rate-row:last-child {
    border-bottom: none;
}

.rate-name {
    color: #666;
    font-weight: 500;
}

.rate-info {
    text-align: right;
}

.rate-value {
    color: #333;
    font-weight: bold;
    font-size: 14px;
}

.rate-change {
    font-size: 10px;
    margin-top: 2px;
    padding: 2px 6px;
    border-radius: 8px;
    font-weight: bold;
}

.rate-up {
    background: #ffebee;
    color: #c62828;
}

.rate-down {
    background: #e8f5e8;
    color: #2e7d32;
}

/* 간결한 환율 스타일 */
.rate-row-compact {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255, 107, 53, 0.1);
    visibility: visible !important;
    opacity: 1 !important;
}

.rate-row-compact:last-child {
    border-bottom: none;
}

.rate-label {
    color: #666;
    font-weight: 500;
    font-size: 12px;
}

.rate-main {
    display: flex;
    align-items: center;
    gap: 6px;
}

.rate-value-main {
    color: #333;
    font-weight: bold;
    font-size: 13px;
}

.rate-change-compact {
    font-size: 9px;
    padding: 1px 4px;
    border-radius: 4px;
    font-weight: bold;
}

.rate-buysell {
    display: flex;
    gap: 8px;
    font-size: 11px;
}

.rate-buy {
    color: #c62828;
    font-weight: 500;
}

.rate-sell {
    color: #2e7d32;
    font-weight: 500;
}

.rate-update {
    text-align: center;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 107, 53, 0.1);
}

.rate-update small {
    color: #888;
    font-size: 10px;
}

.loading {
    text-align: center;
    padding: 25px;
    color: #999;
}

.loading-spinner {
    border: 3px solid rgba(255, 107, 53, 0.2);
    border-top: 3px solid #FF6B35;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* 개선된 로딩 애니메이션 */
.loading-enhanced {
    text-align: center;
    padding: 20px;
    color: #999;
    width: 100%;
    min-height: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.loading-dots {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-bottom: 10px;
}

.dot {
    width: 8px;
    height: 8px;
    background: #FF6B35;
    border-radius: 50%;
    animation: bounce 1.4s ease-in-out infinite both;
}

.dot:nth-child(1) {
    animation-delay: -0.32s;
}

.dot:nth-child(2) {
    animation-delay: -0.16s;
}

.dot:nth-child(3) {
    animation-delay: 0s;
}

@keyframes bounce {

    0%,
    80%,
    100% {
        transform: scale(0);
        opacity: 0.5;
    }

    40% {
        transform: scale(1);
        opacity: 1;
    }
}

.loading-text {
    font-size: 12px;
    color: #666;
}

/* 모바일 최적화 */
@media (max-width: 768px) {
    body {
        padding: 8px;
        width: 100%;
        overflow-x: hidden;
    }

    .container {
        padding: 10px;
        width: 100vw;
        max-width: 100vw;
        box-sizing: border-box;
        margin: 0;
    }

    .header {
        flex-direction: column;
        gap: 10px;
    }

    .title {
        font-size: 20px;
        text-align: center;
    }



    .news-title-compact {
        font-size: 13px;
    }

    .news-desc-compact {
        font-size: 11px;
    }

    .bottom-section {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .partnership-contact {
        text-align: center;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }
    
    .partnership-contact-btn {
        font-size: 10px;
        padding: 6px 12px;
        margin: 6px auto;
        display: block;
        text-align: center;
        width: fit-content;
    }

    .weather-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 4px;
    }

    .hourly-weather {
        grid-template-columns: repeat(3, 1fr);
        gap: 3px;
    }

    .weather-hour-item {
        padding: 4px 2px;
    }

    .weather-hour-time {
        font-size: 8px;
    }

    .weather-hour-icon {
        font-size: 12px;
    }

    .weather-hour-temp {
        font-size: 10px;
    }

    .weather-hour-rain {
        font-size: 7px;
    }
}

@media (max-width: 480px) {
    .title {
        font-size: 16px;
        letter-spacing: 0.5px;
    }

    .category-header {
        font-size: 12px;
        padding: 6px 12px;
    }

    .container {
        padding: 8px 0; /* 모바일 기본 좌우 패딩 제거 */
        width: 100vw;
        max-width: 100vw;
        box-sizing: border-box;
        margin: 0;
    }

    .news-item-compact {
        padding: 5px 8px;
        margin-bottom: 3px;
    }

    .news-title-compact {
        font-size: 12px;
    }

    .news-desc-compact {
        font-size: 10px;
    }

    .news-source-compact {
        font-size: 8px;
        padding: 1px 4px;
    }

    .news-time-compact {
        font-size: 8px;
    }

    .news-title {
        font-size: 14px;
    }

    .news-description {
        font-size: 12px;
    }

    .weather-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 3px;
    }

    .hourly-weather {
        grid-template-columns: repeat(3, 1fr);
        gap: 2px;
    }

    .weather-hour-item {
        padding: 3px 1px;
    }

    .weather-hour-time {
        font-size: 7px;
    }

    .weather-hour-icon {
        font-size: 10px;
    }

    .weather-hour-temp {
        font-size: 9px;
    }

    .weather-hour-rain {
        font-size: 6px;
    }

    .weather-item {
        padding: 6px 2px;
    }

    .weather-time {
        font-size: 9px;
    }

    .temperature {
        font-size: 12px;
    }

    .weather-desc {
        font-size: 9px;
    }
}

/* 플로팅 버튼들 */
.floating-buttons {
    position: fixed;
    bottom: 25px;
    right: 25px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 1000;
}

.capture-btn,
.kakao-btn {
    background: #FF6B35;
    color: white;
    border: none;
    border-radius: 50%;
    width: 65px;
    height: 65px;
    font-size: 26px;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(255, 107, 53, 0.4);
    transition: all 0.3s ease;
    /* iOS Safari 터치 최적화 */
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    /* iOS Safari 터치 반응성 */
    -webkit-appearance: none;
    appearance: none;
    /* iOS Safari 터치 영역 확대 */
    min-height: 44px;
    min-width: 44px;
}

.capture-btn:hover,
.kakao-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 25px rgba(255, 107, 53, 0.6);
}

.capture-btn:disabled {
    background: #ccc !important;
    cursor: not-allowed !important;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2) !important;
    opacity: 0.5 !important;
    transform: scale(0.8) !important;
}

.capture-btn:not(:disabled):hover {
    background: linear-gradient(135deg, #FF6B35, #FF8C00) !important;
}

.kakao-btn {
    background: #FEE500;
    color: #333;
    font-size: 30px;
}

.kakao-menu {
    position: absolute;
    bottom: 85px;
    right: 0;
    background: white;
    border-radius: 15px;
    padding: 15px;
    min-width: 250px;
    transform: scale(0);
    transform-origin: bottom right;
    transition: all 0.3s ease;
    border: 2px solid #FF6B35;
    box-shadow: 0 10px 30px rgba(255, 107, 53, 0.3);
}

.kakao-menu.show {
    transform: scale(1);
}

.kakao-menu-item {
    display: block;
    width: 100%;
    padding: 12px 15px;
    margin-bottom: 10px;
    background: linear-gradient(90deg, #FF6B35, #FF8C00);
    color: white;
    text-decoration: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.3s ease;
    text-align: center;
}

.kakao-menu-item:last-child {
    margin-bottom: 0;
}

.kakao-menu-item:hover {
    background: linear-gradient(90deg, #FF8C00, #FFA500);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.4);
    color: white;
    text-decoration: none;
}

/* 제휴 광고 섹션 */
.partnership-section {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 8px;
    padding: 10px;
    border: 1px solid rgba(255, 107, 53, 0.2);
    box-shadow: 0 2px 8px rgba(255, 107, 53, 0.08);
    text-align: center;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    min-height: auto;
    margin-top: 10px;
    margin-bottom: 0px;
    width: 100%;
}

.partnership-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.partnership-description {
    font-size: 12px;
    color: #333;
    margin: 0;
    font-weight: 500;
    line-height: 1.2;
}

.partnership-contact-btn {
    background: linear-gradient(135deg, #FF6B35 0%, #FF8A65 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(255, 107, 53, 0.2);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    position: relative;
}

.partnership-contact-btn::before {
    content: '💬';
    font-size: 14px;
}

.partnership-contact-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
    background: linear-gradient(135deg, #FF5722 0%, #FF7043 100%);
}

.partnership-info {
    font-size: 9px;
    color: #666;
    margin: 0;
    line-height: 1.3;
}

/* 면책 조항 */
.disclaimer {
    margin-top: 8px;
    padding: 6px;
    background: rgba(0, 0, 0, 0.03);
    border-radius: 6px;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.disclaimer p {
    font-size: 8px;
    color: #666;
    line-height: 1.4;
    margin: 0;
    text-align: center;
}

/* 프린트 스타일 */
@media print {
    .floating-buttons {
        display: none;
    }
}

/* 모바일 최적화 - 768px 이하 */
@media (max-width: 768px) {
    body {
        padding: 4px;
        min-height: 100vh;
        display: flex;
        flex-direction: column;
    }

    .container {
        padding: 8px;
        border-radius: 10px;
        flex: 1;
        display: flex;
        flex-direction: column;
    }

    .header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 8px;
        margin-bottom: 8px;
        padding: 12px 15px;
        border-bottom: 2px solid #FF6B35;
        border-radius: 12px;
        background: linear-gradient(135deg, rgba(255, 107, 53, 0.1) 0%, rgba(255, 140, 0, 0.1) 100%);
        box-shadow: 0 3px 10px rgba(255, 107, 53, 0.15);
    }

    .header-left {
        display: flex;
        align-items: center;
        gap: 8px;
    }
    
    .title-section {
        gap: 1px;
    }

    .logo {
        max-height: 50px;
    }

    .title {
        font-size: 18px;
        text-align: left;
        line-height: 1.2;
        letter-spacing: 1px;
    }

    .update-time {
        font-size: 9px;
        padding: 4px 8px;
        border-radius: 12px;
        white-space: nowrap;
        font-weight: bold;
    }
    
    .update-time-container {
        margin-bottom: 8px;
        padding: 0 10px;
    }
    
    .update-time-small {
        font-size: 8px;
        padding: 3px 6px;
        border-radius: 10px;
        font-weight: 500;
    }

    .news-section {
        margin-bottom: 4px;
    }

    .category-header {
        padding: 3px 6px;
        font-size: 11px;
        margin-bottom: 3px;
        border-radius: 6px;
    }

    .news-item-compact {
        padding: 6px 8px;
        margin-bottom: 3px;
        border-radius: 6px;
    }

    .news-title-compact {
        font-size: 14px;
    }

    .news-desc-compact {
        font-size: 12px;
    }

    /* 하단 섹션을 가로로 배치하고 매우 컴팩트하게 */
    .bottom-section {
        grid-template-columns: 0.4fr 0.6fr;
        gap: 4px;
        margin-top: 6px;
        padding-top: 6px;
    }

    .weather-section,
    .rates-section {
        padding: 4px;
        border-radius: 8px;
    }
    
    .weather-section {
        padding: 2px;
    }

    .section-title {
        font-size: 10px;
        margin-bottom: 2px;
    }

    /* 날씨 섹션 최적화 - 모바일에서는 2개 */
    .hourly-weather {
        grid-template-columns: repeat(2, 1fr);
        gap: 2px;
    }

    .weather-hour-item {
        padding: 2px 1px;
    }

    .weather-hour-time {
        font-size: 7px;
        margin-bottom: 1px;
    }

    .weather-hour-icon {
        font-size: 10px;
        margin-bottom: 1px;
    }

    .weather-hour-temp {
        font-size: 9px;
        margin-bottom: 0;
    }

    /* 환율 섹션 최적화 - 매우 간결하게 */
    .rate-row-compact {
        padding: 2px 0;
    }

    .rate-label {
        font-size: 10px;
    }

    .rate-value-main {
        font-size: 11px;
    }

    .rate-change-compact {
        font-size: 7px;
    }

    .rate-buysell {
        font-size: 9px;
        gap: 4px;
    }

    .rate-update small {
        font-size: 8px;
    }

    /* 광고 및 면책조항 */
    .partnership-section {
        margin-top: 8px;
        padding: 8px;
        background: linear-gradient(135deg, #FFF3E0 0%, #FFE0B2 100%);
        border-radius: 8px;
        border: 1px solid rgba(255, 107, 53, 0.3);
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        position: relative;
        z-index: 10;
        width: 100%;
        box-sizing: border-box;
    }

    .partnership-header {
        font-size: 11px;
        margin-bottom: 6px;
        color: #FF6B35;
        font-weight: bold;
        text-align: center;
    }
    
    .partnership-contact {
        text-align: center;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }

    .partnership-contact-btn {
        font-size: 10px;
        padding: 6px 12px;
        background: linear-gradient(90deg, #FF6B35, #FF8C00);
        color: white;
        border: none;
        border-radius: 15px;
        font-weight: bold;
        cursor: pointer;
        box-shadow: 0 2px 6px rgba(255, 107, 53, 0.3);
        margin: 6px auto;
        display: block;
        text-align: center;
        width: fit-content;
    }

    .disclaimer {
        margin-top: 4px;
        padding: 4px;
    }

    .disclaimer p {
        font-size: 7px;
        line-height: 1.1;
        margin-bottom: 1px;
    }

    .weather-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 4px;
    }
}

/* 모바일 최적화 - 480px 이하 (작은 화면) */
@media (max-width: 480px) {
    body {
        padding: 4px;
    }

    .container {
        padding: 8px;
        border-radius: 10px;
    }

    .header {
        justify-content: space-between;
        align-items: center;
        gap: 4px;
        margin-bottom: 4px;
        padding: 8px 10px;
        border-bottom: 2px solid #FF6B35;
        border-radius: 8px;
        background: linear-gradient(135deg, rgba(255, 107, 53, 0.1) 0%, rgba(255, 140, 0, 0.1) 100%);
        box-shadow: 0 2px 6px rgba(255, 107, 53, 0.15);
    }

    .header-left {
        gap: 6px;
    }
    
    .title-section {
        gap: 1px;
    }

    .logo {
        max-height: 32px;
    }

    .title {
        font-size: 15px;
        line-height: 1.1;
        letter-spacing: 0.5px;
    }

    .update-time {
        font-size: 8px;
        padding: 2px 6px;
        white-space: nowrap;
        font-weight: bold;
    }
    
    .update-time-container {
        margin-bottom: 4px;
        padding: 0 6px;
    }
    
    .update-time-small {
        font-size: 7px;
        padding: 2px 4px;
        border-radius: 8px;
        font-weight: 500;
    }

    .news-section {
        margin-bottom: 6px;
    }

    .category-header {
        padding: 3px 6px;
        font-size: 10px;
        margin-bottom: 3px;
    }

    .news-item-compact {
        padding: 6px 8px;
        margin-bottom: 3px;
    }

    .news-title-compact {
        font-size: 13px;
        line-height: 1.3;
    }

    .news-desc-compact {
        font-size: 11px;
    }

    .news-source-compact {
        font-size: 9px;
    }

    .news-time-compact {
        font-size: 9px;
    }

    /* 하단 섹션 더욱 컴팩트하게 */
    .bottom-section {
        grid-template-columns: 1fr 1fr;
        gap: 4px;
        margin-top: 8px;
        padding-top: 6px;
    }

    .weather-section,
    .rates-section {
        padding: 3px;
        border-radius: 6px;
    }

    .section-title {
        font-size: 10px;
        margin-bottom: 2px;
    }

    /* 모바일에서는 시간대별 날씨 완전 제거 */
    .hourly-weather {
        display: none;
    }

    /* 환율 - 더욱 간결하게 */
    .rate-row-compact {
        padding: 3px 0;
    }

    .rate-label {
        font-size: 10px;
    }

    .rate-value-main {
        font-size: 11px;
    }

    .rate-change-compact {
        font-size: 7px;
        padding: 1px 3px;
    }

    .rate-buysell {
        font-size: 9px;
        gap: 4px;
    }

    .rate-update small {
        font-size: 8px;
    }

    /* 광고 및 면책조항 */
    .partnership-section {
        margin-top: 8px;
        padding: 8px;
        background: linear-gradient(135deg, #FFF3E0 0%, #FFE0B2 100%);
        border-radius: 8px;
        border: 1px solid rgba(255, 107, 53, 0.3);
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        position: relative;
        z-index: 10;
        width: 100%;
        box-sizing: border-box;
    }

    .partnership-header {
        font-size: 11px;
        margin-bottom: 6px;
        color: #FF6B35;
        font-weight: bold;
        text-align: center;
    }
    
    .partnership-contact {
        text-align: center;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }

    .partnership-description {
        font-size: 10px;
        margin-bottom: 6px;
    }

    .partnership-contact-btn {
        font-size: 10px;
        padding: 6px 12px;
        background: linear-gradient(90deg, #FF6B35, #FF8C00);
        color: white;
        border: none;
        border-radius: 15px;
        font-weight: bold;
        cursor: pointer;
        box-shadow: 0 2px 6px rgba(255, 107, 53, 0.3);
        margin: 6px auto;
        display: block;
        text-align: center;
        width: fit-content;
    }

    .partnership-info {
        font-size: 8px;
        margin-top: 6px;
    }

    .disclaimer {
        margin-top: 8px;
        padding: 6px;
    }

    .disclaimer p {
        font-size: 8px;
        line-height: 1.3;
        margin-bottom: 3px;
    }

    /* 플로팅 버튼 크기 조정 */
    .capture-btn,
    .kakao-btn {
        width: 45px;
        height: 45px;
        font-size: 18px;
    }

    .floating-buttons {
        bottom: 10px;
        right: 10px;
        gap: 8px;
    }

    .kakao-menu {
        min-width: 200px;
        padding: 10px;
        bottom: 55px;
        /* 버튼 크기에 맞춰 조정 */
    }

    .kakao-menu-item {
        padding: 8px 12px;
        margin-bottom: 6px;
        font-size: 12px;
    }
}

/* 매우 작은 화면 - 360px 이하 */
@media (max-width: 360px) {
    body {
        padding: 2px;
    }

    .container {
        padding: 4px;
        width: 100vw;
        max-width: 100vw;
        box-sizing: border-box;
        margin: 0;
        border-radius: 8px;
    }

    .title {
        font-size: 12px;
        line-height: 1;
    }

    .logo {
        max-height: 25px;
    }

    .header {
        justify-content: space-between;
        align-items: center;
        gap: 3px;
        margin-bottom: 3px;
        padding-bottom: 2px;
    }

    .header-left {
        gap: 4px;
    }

    .update-time {
        font-size: 6px;
        padding: 1px 3px;
        white-space: nowrap;
    }

    .news-section {
        margin-bottom: 4px;
    }

    .category-header {
        padding: 2px 6px;
        font-size: 9px;
        margin-bottom: 2px;
    }

    .news-item-compact {
        padding: 5px 6px;
        margin-bottom: 2px;
    }

    .news-title-compact {
        font-size: 12px;
    }

    .news-desc-compact {
        font-size: 10px;
    }

    /* 하단 섹션 최소화 */
    .weather-section,
    .rates-section {
        padding: 6px;
    }

    .section-title {
        font-size: 11px;
        margin-bottom: 4px;
    }

    /* 날씨 최소화 - 모바일에서는 2개 */
    .hourly-weather {
        grid-template-columns: repeat(2, 1fr);
        gap: 1px;
    }

    .weather-hour-item {
        padding: 2px 1px;
    }

    .weather-hour-time {
        font-size: 6px;
        margin-bottom: 1px;
    }

    .weather-hour-icon {
        font-size: 9px;
        margin-bottom: 1px;
    }

    .weather-hour-temp {
        font-size: 7px;
        margin-bottom: 0;
    }

    /* 환율 최소화 */
    .rate-label {
        font-size: 9px;
    }

    .rate-value-main {
        font-size: 10px;
    }

    .rate-change-compact {
        font-size: 6px;
    }

    .rate-buysell {
        font-size: 8px;
    }

    .rate-update small {
        font-size: 7px;
    }

    /* 제휴 광고 섹션 */
    .partnership-section {
        margin-top: 6px;
        padding: 6px;
        background: linear-gradient(135deg, #FFF3E0 0%, #FFE0B2 100%);
        border-radius: 6px;
        border: 1px solid rgba(255, 107, 53, 0.3);
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        position: relative;
        z-index: 10;
        width: 100%;
        box-sizing: border-box;
    }

    .partnership-header {
        font-size: 9px;
        margin-bottom: 4px;
        color: #FF6B35;
        font-weight: bold;
        text-align: center;
    }

    .partnership-contact-btn {
        font-size: 8px;
        padding: 4px 8px;
        background: linear-gradient(90deg, #FF6B35, #FF8C00);
        color: white;
        border: none;
        border-radius: 10px;
        font-weight: bold;
        cursor: pointer;
        box-shadow: 0 2px 4px rgba(255, 107, 53, 0.3);
        margin: 4px auto;
        display: block;
        text-align: center;
        width: fit-content;
    }
}

/*
 모바일에서 플로팅 버튼 최적화 */
@media (max-width: 768px) {
    .floating-buttons {
        bottom: 8px;
        right: 8px;
        gap: 6px;
    }

    .capture-btn,
    .kakao-btn {
        width: 40px;
        height: 40px;
        font-size: 16px;
        box-shadow: 0 4px 15px rgba(255, 107, 53, 0.3);
    }

    .capture-btn:disabled {
        background: #ccc !important;
        cursor: not-allowed !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
        opacity: 0.5 !important;
        transform: scale(0.8) !important;
    }

    .kakao-menu {
        min-width: 180px;
        padding: 8px;
        bottom: 48px;
        right: 0;
    }

    .kakao-menu-item {
        padding: 6px 10px;
        margin-bottom: 4px;
        font-size: 11px;
        border-radius: 8px;
    }
}

@media (max-width: 480px) {
    .floating-buttons {
        bottom: 6px;
        right: 6px;
        gap: 5px;
    }

    .capture-btn,
    .kakao-btn {
        width: 35px;
        height: 35px;
        font-size: 14px;
    }

    .kakao-menu {
        min-width: 160px;
        padding: 6px;
        bottom: 42px;
    }

    .kakao-menu-item {
        padding: 5px 8px;
        margin-bottom: 3px;
        font-size: 10px;
    }
}

@media (max-width: 360px) {
    .floating-buttons {
        bottom: 5px;
        right: 5px;
        gap: 4px;
    }

    .capture-btn,
    .kakao-btn {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }

    .kakao-menu {
        min-width: 140px;
        padding: 5px;
        bottom: 38px;
    }

    .kakao-menu-item {
        padding: 4px 6px;
        margin-bottom: 2px;
        font-size: 9px;
    }
}

/* 스크
린샷 캡처 시 모든 요소 강제 표시 */
.rates-section,
.rates-table,
#ratesTable,
.rate-row,
.rate-row-compact,
.rate-value,
.rate-value-main,
.rate-name,
.rate-label,
.rate-info,
.rate-main,
.rate-buysell,
.disclaimer,
.disclaimer p,
.partnership-section,
.partnership-header,
.partnership-contact,
.partnership-contact-btn,
.partnership-description,
.partnership-info {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
}

.rate-row,
.rate-row-compact,
.rate-main,
.rate-buysell {
    display: flex !important;
}

/* 환율 섹션 특별 처리 */
.rates-section {
    min-height: 100px !important;
    background: linear-gradient(135deg, #FFFBF0 0%, #FFF3E0 100%) !important;
    border: 1px solid rgba(255, 107, 53, 0.2) !important;
    border-radius: 8px !important;
    padding: 6px !important;
}

.rates-table {
    font-size: 13px !important;
    width: 100% !important;
}

.rate-row,
.rate-row-compact {
    justify-content: space-between !important;
    align-items: center !important;
    padding: 6px 0 !important;
    border-bottom: 1px solid rgba(255, 107, 53, 0.1) !important;
}

/* 면책조항 특별 처리 */
.disclaimer {
    margin-top: 15px !important;
    padding: 10px !important;
    background: rgba(0, 0, 0, 0.05) !important;
    border-radius: 8px !important;
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
}

.disclaimer p {
    font-size: 9px;
    color: #666;
    line-height: 1.5;
    margin-bottom: 6px;
    text-align: center;
}

.disclaimer p:last-child {
    margin-bottom: 0 !important;
}
/* 스크린샷
 캡처 시 모든 요소 강제 표시 - 최우선 규칙 */
body .container .rates-section,
body .container .rates-table,
body .container #ratesTable,
body .container .rate-row,
body .container .rate-row-compact,
body .container .rate-value,
body .container .rate-value-main,
body .container .rate-name,
body .container .rate-label,
body .container .rate-info,
body .container .rate-main,
body .container .rate-buysell,
body .container .disclaimer,
body .container .disclaimer p,
body .container .partnership-section,
body .container .partnership-header,
body .container .partnership-contact,
body .container .partnership-contact-btn,
body .container .partnership-description,
body .container .partnership-info,
body .container .bottom-section {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    z-index: auto !important;
}

body .container .rate-row,
body .container .rate-row-compact,
body .container .rate-main,
body .container .rate-buysell {
    display: flex !important;
}

/* 환율 섹션 최우선 처리 */
body .container .rates-section {
    min-height: 100px !important;
    background: linear-gradient(135deg, #FFFBF0 0%, #FFF3E0 100%) !important;
    border: 1px solid rgba(255, 107, 53, 0.2) !important;
    border-radius: 8px !important;
    padding: 6px !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

body .container .rates-table,
body .container #ratesTable {
    font-size: 13px !important;
    width: 100% !important;
    display: block !important;
}

body .container .rate-row,
body .container .rate-row-compact {
    justify-content: space-between !important;
    align-items: center !important;
    padding: 6px 0 !important;
    border-bottom: 1px solid rgba(255, 107, 53, 0.1) !important;
    width: 100% !important;
}

/* 면책조항 최우선 처리 */
body .container .disclaimer {
    margin-top: 15px !important;
    padding: 10px !important;
    background: rgba(0, 0, 0, 0.05) !important;
    border-radius: 8px !important;
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

body .container .disclaimer p {
    font-size: 9px;
    color: #666;
    line-height: 1.5;
    margin-bottom: 6px;
    text-align: center;
    display: block !important;
}

body .container .disclaimer p:last-child {
    margin-bottom: 0 !important;
}

/* 하단 섹션 최우선 처리 */
body .container .bottom-section {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
    margin-top: 15px !important;
    padding-top: 10px !important;
    border-top: 2px solid #FF6B35 !important;
    width: 100% !important;
}

/* 통합 시장 정보 스타일 (컴팩트) */
.market-section {
    margin-top: 0px;
    padding: 12px;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(255, 107, 53, 0.08);
    border: 1px solid rgba(255, 107, 53, 0.2);
    min-height: 120px;
    display: flex;
    flex-direction: column;
    margin-bottom: 0px;
    transition: all 0.3s ease;
}

.market-section:hover {
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.12);
    transform: translateY(-1px);
}

.market-header {
    font-size: 14px;
    font-weight: 700;
    color: #FF6B35;
    margin-bottom: 8px;
    text-align: center;
    padding-bottom: 6px;
    border-bottom: 2px solid rgba(255, 107, 53, 0.3);
    text-shadow: 0 1px 2px rgba(255, 107, 53, 0.2);
}

.market-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin-top: 4px;
    flex: 1; /* 남은 공간 채우기 */
    min-height: 120px; /* 날씨 섹션과 높이 맞추기 */
}

/* 모바일에서 한 줄에 3개 강제 */
@media (max-width: 768px) {
    .market-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 3px;
    }
    
    .market-item {
        padding: 4px 2px;
        min-height: 40px;
    }
    
    .market-item-name {
        font-size: 9px;
        margin-bottom: 1px;
    }
    
    .market-item-price {
        font-size: 10px;
    }
}

.market-item {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 6px;
    padding: 8px 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 107, 53, 0.15);
    min-height: 50px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-shadow: 0 2px 6px rgba(255, 107, 53, 0.08);
}

.market-item:hover {
    background: linear-gradient(135deg, #ffffff 0%, #fff3e0 100%);
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(255, 107, 53, 0.15);
    border-color: #FF6B35;
}

.market-item.exchange-item {
    background: linear-gradient(135deg, #FFF3E0 0%, #FFE0B2 100%);
    border-color: #FFB74D;
}

.market-item.stock-item {
    background: linear-gradient(135deg, #E8F5E8 0%, #C8E6C9 100%);
    border-color: #81C784;
}

.market-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2px;
}

.market-item-name {
    font-size: 11px;
    font-weight: 600;
    color: #FF6B35;
    margin-bottom: 3px;
    text-align: center;
    line-height: 1.1;
    word-break: keep-all;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
    padding: 0 1px;
}

.market-item-price {
    font-size: 12px;
    font-weight: bold;
    color: #333;
    margin-bottom: 0px;
    text-align: center;
    line-height: 1.1;
    word-break: keep-all;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
    padding: 0 1px;
}

.market-item-change {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
}

.market-item-change.rate-up {
    color: #00C851;
}

.market-item-change.rate-down {
    color: #ff4444;
}

.change-symbol {
    font-size: 10px;
}

.change-value {
    font-weight: 700;
    font-size: 11px;
}

/* 모바일 반응형 */
@media (max-width: 768px) {
    .market-section {
        margin-top: 0px;
        padding: 2px;
        min-height: 200px;
    }
    
    .market-header {
        font-size: 13px;
        margin-bottom: 6px;
        padding-bottom: 4px;
    }
    
    .market-grid {
        grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
        gap: 3px;
        margin-top: 3px;
    }
    
    .market-item {
        padding: 6px 2px;
        min-height: 40px;
    }
    
    .market-item-name {
        font-size: 10px;
        margin-bottom: 4px;
        text-align: center;
        word-break: keep-all;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    
    .market-item-price {
        font-size: 12px;
        margin-bottom: 0px;
        text-align: center;
        word-break: keep-all;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    
    .market-item-change {
        font-size: 9px;
        gap: 1px;
    }
    
    .change-symbol {
        font-size: 8px;
    }
    
    .change-value {
        font-size: 9px;
    }
}

@media (max-width: 480px) {
    .market-section {
        margin-top: 0px;
        padding: 2px;
        min-height: 180px;
    }
    
    .market-header {
        font-size: 12px;
        margin-bottom: 5px;
        padding-bottom: 3px;
    }
    
    .market-grid {
        grid-template-columns: repeat(auto-fit, minmax(75px, 1fr));
        gap: 2px;
        margin-top: 2px;
    }
    
    .market-item {
        padding: 4px 1px;
        min-height: 35px;
    }
    
    .market-item-name {
        font-size: 9px;
        margin-bottom: 3px;
        text-align: center;
        word-break: keep-all;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    
    .market-item-price {
        font-size: 11px;
        margin-bottom: 0px;
        text-align: center;
        word-break: keep-all;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    
    .market-item-change {
        font-size: 8px;
        gap: 1px;
    }
    
    .change-symbol {
        font-size: 7px;
    }
    
    .change-value {
        font-size: 8px;
    }
}

/* 뉴스 팝업 스타일 */
.news-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(5px);
}

.popup-content {
    background: white;
    border-radius: 15px;
    padding: 25px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
}

.popup-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    border-bottom: 2px solid #FF6B35;
    padding-bottom: 15px;
}

.popup-title-section {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    padding-right: 20px;
}

.popup-section-icon {
    font-size: 20px;
}

.popup-title {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    margin: 0;
    line-height: 1.4;
}

.popup-count {
    font-size: 14px;
    color: #666;
    font-weight: normal;
}

.popup-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.popup-close:hover {
    background: #f0f0f0;
    color: #666;
}

.popup-body {
    margin-bottom: 20px;
}

.popup-body p {
    font-size: 14px;
    line-height: 1.6;
    color: #555;
    margin-bottom: 15px;
}

.popup-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #888;
    padding-top: 10px;
    border-top: 1px solid #eee;
}

.popup-time {
    color: #FF6B35;
    font-weight: 500;
}

.popup-source {
    background: #f0f0f0;
    padding: 4px 8px;
    border-radius: 12px;
    font-weight: 500;
}

.popup-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.popup-btn {
    background: #FF6B35;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.popup-btn:hover {
    background: #e55a2b;
    transform: translateY(-1px);
}

.popup-btn-secondary {
    background: #666;
}

.popup-btn-secondary:hover {
    background: #555;
}

/* 더보기 버튼 스타일 */
.more-btn {
    background: #FF6B35;
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
    margin-left: 8px;
    transition: all 0.2s ease;
    opacity: 0;
    transform: translateX(10px);
}

.more-btn:hover {
    background: #e55a2b;
}

/* 뉴스 아이템 호버 시 더보기 버튼 표시 */
.news-item-compact:hover .more-btn {
    opacity: 1;
    transform: translateX(0);
}

/* 섹션 더보기 버튼 스타일 */
.section-more-btn {
    background: #FF6B35;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    margin-left: auto;
    transition: all 0.2s ease;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    z-index: 10;
}

.section-more-btn:hover {
    background: #e55a2b;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(255, 107, 53, 0.3);
}

/* 섹션 팝업 뉴스 아이템 스타일 (개선된 버전) */
.popup-news-item {
    border-bottom: 1px solid #eee;
    padding: 20px 0;
    margin-bottom: 20px;
    background: #fff;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.popup-news-item:hover {
    background: #f8f9fa;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.popup-news-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.popup-news-header {
    margin-bottom: 12px;
}

.popup-news-title {
    font-size: 16px;
    font-weight: bold;
    color: #333;
    margin-bottom: 8px;
    line-height: 1.3;
    cursor: pointer;
}

.popup-news-title:hover {
    color: #FF6B35;
}

.popup-news-desc {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
    margin-bottom: 15px;
}

.popup-news-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    font-size: 12px;
    color: #888;
}

.popup-news-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.popup-btn-primary {
    background: #FF6B35;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1;
    min-width: 120px;
}

.popup-btn-primary:hover {
    background: #e55a2b;
    transform: translateY(-1px);
}

.popup-btn-secondary {
    background: #6c757d;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1;
    min-width: 120px;
}

.popup-btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

/* 이미지 저장 시에만 팝업과 더보기 버튼 숨기기 */
body.capturing .container .news-popup,
body.capturing .container .more-btn,
body.capturing .container .section-more-btn {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

/* 모바일 반응형 */
@media (max-width: 768px) {
    .popup-content {
        width: 95%;
        padding: 20px;
        max-height: 85vh;
    }
    
    .popup-title {
        font-size: 16px;
    }
    
    .popup-news-desc {
        font-size: 13px;
    }
    
    .popup-news-actions {
        flex-direction: column;
    }
    
    .popup-btn-primary,
    .popup-btn-secondary {
        width: 100%;
        padding: 12px 20px;
    }
    
    .popup-news-item {
        padding: 15px 0;
        margin-bottom: 15px;
    }
}

@media (max-width: 480px) {
    .popup-content {
        width: 98%;
        padding: 15px;
    }
    
    .popup-title {
        font-size: 15px;
    }
    
    .popup-news-desc {
        font-size: 12px;
    }
    
    .popup-section-icon {
        font-size: 18px;
    }
    
    .popup-count {
        font-size: 12px;
    }
}

@media (max-width: 768px) {
  .bottom-section {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-top: 4px;
    padding-top: 2px;
  }
  .weather-section,
  .market-section {
    width: 100%;
    margin-bottom: 6px;
    min-height: unset;
    padding: 6px 0 8px 0; /* 좌우 패딩 제거 - 캡처 시 검은 여백 방지 */
  }
  .market-section {
    margin-bottom: 0;
    padding-bottom: 10px;
  }
  .market-grid {
    gap: 3px;
  }
  .section-title {
    font-size: 10px;
    margin-bottom: 2px;
  }
}

@media (max-width: 768px) {
    body {
        padding: 1px;
    }
    .container {
        padding: 1px;
        width: 100vw;
        max-width: 100vw;
        margin: 0;
    }
    
    /* 모바일에서 좌우로 늘려서 세로 길이 줄이기 */
    .news-item-compact {
        padding: 3px 6px !important;
        margin-bottom: 2px !important;
    }
    
    .category-header {
        padding: 4px 8px !important;
        margin-bottom: 4px !important;
    }
    
    .news-section {
        margin-bottom: 6px !important;
    }
    
    .bottom-section {
        margin-top: 8px !important;
        padding-top: 8px !important;
        gap: 6px !important;
    }
    
    .weather-section,
    .market-section {
        padding: 4px !important;
    }
    
    .partnership-section {
        padding: 8px !important;
        margin-top: 6px !important;
    }
    
    .disclaimer {
        padding: 6px !important;
        margin-top: 4px !important;
    }
    .bottom-section {
        grid-template-columns: 0.28fr 0.72fr;
        gap: 2px;
        margin-top: 2px;
        padding-top: 2px;
    }
    .weather-section,
    .market-section {
        padding: 2px !important;
        min-height: auto !important;
        border-radius: 6px !important;
    }
    .market-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 2px !important;
        margin-top: 0 !important;
    }
    .market-item {
        padding: 4px 2px !important;
        min-height: 38px !important;
        border-radius: 6px !important;
        font-size: 0.85rem !important;
    }
    .market-item-name {
        font-size: 0.75rem !important;
        margin-bottom: 0 !important;
        line-height: 1.1 !important;
    }
    .market-item-price {
        font-size: 0.9rem !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    .weather-grid {
        margin: 0 !important;
    }
    /* 이미지 저장(캡처) 시에도 동일하게 적용 */
    body.capturing .container,
    body.capturing .bottom-section,
    body.capturing .weather-section,
    body.capturing .market-section,
    body.capturing .market-grid,
    body.capturing .market-item {
        padding: 2px !important;
        margin: 0 !important;
        min-height: auto !important;
        border-radius: 6px !important;
        font-size: 0.85rem !important;
    }
}

/* 이미지 캡처 시 가로 크기 보장 */
/* 캡처 시 좌우 여백 제거 및 풀폭 강제 */
body.capturing { padding: 0 !important; }
body.capturing .container {
    position: static !important;
    left: 0 !important; right: 0 !important;
    min-width: 100vw !important;
    width: 100vw !important;
    max-width: 100vw !important;
    max-height: none !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    overflow: visible !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

/* 이미지 캡처 시 여백 최소화 */
body.capturing .header {
    margin-bottom: 8px !important;
    padding: 8px 12px !important;
}

body.capturing .news-section {
    margin-bottom: 6px !important;
}

body.capturing .category-header {
    padding: 4px 8px !important;
    margin-bottom: 4px !important;
}

body.capturing .news-item-compact {
    padding: 3px 6px !important;
    margin-bottom: 2px !important;
}

body.capturing .bottom-section {
    margin-top: 8px !important;
    padding-top: 8px !important;
    gap: 6px !important;
}

body.capturing .weather-section,
body.capturing .market-section {
    padding: 4px !important;
}

body.capturing .partnership-section {
    padding: 6px !important;
    margin-top: 6px !important;
}

body.capturing .disclaimer {
    margin-top: 6px !important;
    padding: 4px !important;
}

body.capturing .bottom-section {
    width: 100% !important;
    max-width: none !important;
    overflow: visible !important;
}

body.capturing .partnership-section {
    width: 100% !important;
    max-width: none !important;
    overflow: visible !important;
}

body.capturing .disclaimer {
    width: 100% !important;
    max-width: none !important;
    overflow: visible !important;
}

/* 모바일 캡처 시 가로폭 강제 확장 */
/* 모바일 캡처 시 가로폭을 약간 더 넓게(100vw보다 크게) 만들어 좌우 공백 방지 */
@media (max-width: 768px) {
  body.capturing,
  body.capturing html {
    width: 100vw !important;
    overflow-x: hidden !important;
  }
  body.capturing .container {
    margin: 0 !important;
    width: 100vw !important;
    max-width: 100vw !important;
  }
}
