* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', sans-serif;
    background: #f5f5f7;
    color: #333;
    overscroll-behavior: none;
}

body {
    overflow: hidden;
}

/* ─── Navbar ─────────────────────────────────── */
.navbar {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    position: sticky;
    top: 0;
    z-index: 100;
    flex-shrink: 0;
}

.nav-brand {
    font-size: 18px;
    font-weight: 700;
    color: #111;
    letter-spacing: -0.5px;
    white-space: nowrap;
}

.nav-tabs {
    display: flex;
    gap: 6px;
}

.nav-tab {
    background: none;
    border: 1px solid transparent;
    font-size: 13px;
    font-weight: 600;
    color: #999;
    cursor: pointer;
    padding: 7px 14px;
    border-radius: 8px;
    transition: all 0.2s ease;
    white-space: nowrap;
    touch-action: manipulation;
}

.nav-tab:hover   { color: #111; background: rgba(0,0,0,0.04); }
.nav-tab.active  { color: #111; background: rgba(0,0,0,0.07); border-color: rgba(0,0,0,0.1); }

/* ─── Tab Content ─────────────────────────────── */
.tab-content {
    display: none;
    height: calc(100dvh - 60px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.tab-content.active {
    display: block;
    animation: fadeInUp 0.22s ease;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ─── Wrapper ─────────────────────────────────── */
.wrapper {
    width: 100%;
    padding: 36px 32px 60px;
    max-width: 1100px;
    margin: 0 auto;
}

/* ─── Main Layout ─────────────────────────────── */
.main {
    display: flex;
    gap: 36px;
    align-items: flex-start;
    margin-bottom: 32px;
}

/* ─── Color Box ───────────────────────────────── */
.color-box {
    width: 260px;
    height: 260px;
    border-radius: 22px;
    background-color: rgb(0, 0, 0);
    transition: background-color 0.06s linear;
    box-shadow:
        0 16px 48px rgba(0, 0, 0, 0.2),
        inset 0 0 40px rgba(255, 255, 255, 0.05);
    flex-shrink: 0;
    border: 1px solid rgba(0, 0, 0, 0.07);
    position: relative;
    overflow: hidden;
}

.color-box::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg,
        rgba(255,255,255,0.13) 0%,
        transparent 50%,
        rgba(0,0,0,0.07) 100%);
    pointer-events: none;
    border-radius: 22px;
}

/* ─── Info Panel ──────────────────────────────── */
.info-panel {
    display: flex;
    flex-direction: column;
    gap: 14px;
    flex-grow: 1;
    background: #fff;
    border-radius: 18px;
    padding: 22px;
    border: 1px solid rgba(0,0,0,0.07);
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
}

/* ─── RGB Values ──────────────────────────────── */
.rgb-values {
    display: flex;
    gap: 10px;
}

.rgb-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 14px 8px;
    border-radius: 12px;
    background: #f5f5f7;
    border: 2px solid transparent;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
    cursor: pointer;
    user-select: none;
    touch-action: manipulation;
}

/* 채널 선택 */
.rgb-item.channel-selected {
    border-color: #111;
    background: #fff;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    transform: translateY(-2px);
}

.rgb-item.channel-selected .rgb-label { color: #111; }

/* 룰렛 스핀 */
.rgb-item.spinning {
    border-color: #111;
    background: #fff;
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
}

.rgb-item.spinning .rgb-value {
    animation: digitFlicker 0.08s linear infinite;
}

@keyframes digitFlicker {
    0%   { transform: translateY(0);    opacity: 1; }
    30%  { transform: translateY(-5px); opacity: 0.4; }
    60%  { transform: translateY(5px);  opacity: 0.4; }
    100% { transform: translateY(0);    opacity: 1; }
}

/* 착지 */
.rgb-item.landed {
    animation: landBounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    border-color: #111;
}

@keyframes landBounce {
    0%   { transform: scale(1.1); }
    60%  { transform: scale(0.97); }
    100% { transform: scale(1); }
}

.rgb-label {
    font-size: 10px;
    font-weight: 700;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.rgb-value {
    font-size: 32px;
    font-weight: 700;
    color: #111;
    font-family: 'Monaco', 'Courier New', monospace;
    line-height: 1;
    min-width: 56px;
    text-align: center;
}

/* ─── Color Name ──────────────────────────────── */
.color-name-display {
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 700;
    color: #111;
    background: #f5f5f7;
    border-radius: 10px;
    border: 1px solid rgba(0,0,0,0.06);
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.color-name-display.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ─── Code Box ────────────────────────────────── */
.code-box {
    padding: 14px 18px;
    background: #f5f5f7;
    border-radius: 10px;
    border: 1px solid rgba(0,0,0,0.06);
}

.code-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.code-label {
    font-size: 10px;
    font-weight: 700;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.code-value {
    font-size: 18px;
    font-weight: 700;
    color: #111;
    font-family: 'Monaco', 'Courier New', monospace;
}

/* ─── Buttons ─────────────────────────────────── */
.button-section {
    display: flex;
    gap: 8px;
}

.btn {
    padding: 11px 10px;
    border-radius: 9px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    touch-action: manipulation;
}

.btn-reset {
    flex: 1;
    background: #f0f0f2;
    color: #333;
    border: 1px solid rgba(0,0,0,0.1);
}

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

.btn-copy {
    flex: 1;
    background: #111;
    color: #fff;
}

.btn-copy:hover { background: #333; transform: translateY(-1px); }
.btn:active { transform: scale(0.97) !important; }

/* ─── Mobile Adjust ───────────────────────────── */
.mobile-adjust {
    background: #f5f5f7;
    border-radius: 12px;
    padding: 12px 14px;
    border: 1px solid rgba(0,0,0,0.06);
}

.mobile-adj-label {
    font-size: 11px;
    font-weight: 700;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 10px;
}

.mobile-adj-label span {
    color: #111;
    font-weight: 700;
}

.mobile-adj-btns {
    display: flex;
    gap: 8px;
}

.adj-btn {
    flex: 1;
    padding: 10px 0;
    background: #fff;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    color: #111;
    cursor: pointer;
    transition: all 0.15s ease;
    touch-action: manipulation;
    min-height: 44px;
}

.adj-btn:hover  { background: #f0f0f2; }
.adj-btn:active { transform: scale(0.96); background: #e8e8ea; }

/* 데스크탑에서는 숨김 — 모바일에서만 */
@media (min-width: 601px) {
    .mobile-adjust { display: none; }
}

/* ─── Keyboard Guide ──────────────────────────── */
.keyboard-guide {
    padding: 10px 14px;
    background: #f5f5f7;
    border-left: 3px solid #111;
    border-radius: 8px;
}

.guide-title {
    font-size: 10px;
    font-weight: 700;
    color: #111;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 5px;
}

.guide-text {
    font-size: 11px;
    color: #777;
    line-height: 1.8;
}

.desktop-only {
    display: block;
}

/* ─── Family Selector ─────────────────────────── */
.family-section {
    margin-bottom: 28px;
}

.family-section-title {
    font-size: 11px;
    font-weight: 700;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 12px;
}

.family-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.family-chip {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 7px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: 2px solid transparent;
    background: #fff;
    color: #444;
    transition: all 0.2s ease;
    touch-action: manipulation;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.family-chip::before {
    content: '';
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--chip-c, #aaa);
    display: inline-block;
    flex-shrink: 0;
}

.family-chip:hover {
    border-color: var(--chip-c, #aaa);
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

.family-chip.active {
    background: #111;
    color: #fff;
    border-color: #111;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
}

.family-chip.active::before {
    background: var(--chip-c, #fff);
}

/* ─── Similar Colors ──────────────────────────── */
.similar-colors-section { margin-bottom: 28px; }

.similar-title {
    font-size: 11px;
    font-weight: 700;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 14px;
}

.similar-colors-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* 그룹 (swatch + 이름) */
.similar-color-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.similar-color-item {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    cursor: pointer;
    border: 2px solid transparent;
    position: relative;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    touch-action: manipulation;
}

.similar-color-item:hover, .similar-color-item:active {
    transform: scale(1.15) translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.18);
    border-color: rgba(0,0,0,0.15);
}

/* 이름 라벨 (모바일용 — 항상 표시) */
.similar-color-label {
    font-size: 9px;
    font-weight: 600;
    color: #666;
    text-align: center;
    max-width: 56px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: none; /* 데스크탑에선 숨김 */
}

/* 툴팁 (데스크탑 hover) */
.similar-color-tooltip {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: #111;
    color: #fff;
    padding: 5px 9px;
    border-radius: 7px;
    font-size: 11px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease;
    z-index: 50;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.similar-color-tooltip::after {
    content: '';
    position: absolute;
    top: 100%; left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: #111;
}

.similar-color-item:hover .similar-color-tooltip { opacity: 1; }

.tooltip-name {
    font-weight: 700;
    font-size: 11px;
}

.tooltip-hex {
    font-family: 'Monaco', monospace;
    opacity: 0.7;
    font-size: 10px;
}

/* ─── Color Search ────────────────────────────── */
.color-search { margin-bottom: 24px; }

.color-input {
    width: 100%;
    padding: 13px 16px;
    border: 1px solid rgba(0,0,0,0.12);
    border-radius: 10px;
    background: #fff;
    color: #111;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.2s ease;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
    -webkit-appearance: none;
    appearance: none;
}

.color-input::placeholder { color: #bbb; }
.color-input:focus {
    outline: none;
    border-color: #111;
    box-shadow: 0 0 0 3px rgba(0,0,0,0.08);
}

.search-results {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.search-result-item {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 11px 14px;
    background: #fff;
    border-radius: 9px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid rgba(0,0,0,0.07);
    border-left: 3px solid #111;
    touch-action: manipulation;
}

.search-result-item:hover { background: #f5f5f7; transform: translateX(3px); }

.search-result-color {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

.search-result-name { font-weight: 600; color: #111; font-size: 14px; }
.search-result-hex  { font-size: 11px; color: #888; font-family: 'Monaco', monospace; margin-top: 2px; }

/* ─── Design Inspiration Tab ──────────────────── */
.inspiration-wrapper {
    padding: 40px 0;
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.inspiration-wrapper h2 {
    font-size: 26px;
    font-weight: 700;
    color: #111;
    margin-bottom: 6px;
    letter-spacing: -0.5px;
}

.inspiration-subtitle {
    font-size: 13px;
    color: #999;
    margin-bottom: 28px;
}

/* 릴 */
.inspiration-reel-wrapper {
    position: relative;
    height: 100px;
    overflow: hidden;
    background: #fff;
    border-radius: 18px;
    border: 1px solid rgba(0,0,0,0.08);
    box-shadow: 0 4px 24px rgba(0,0,0,0.06);
    margin-bottom: 14px;
    cursor: pointer;
    touch-action: none;
    user-select: none;
}

.reel-overlay {
    position: absolute;
    left: 0; right: 0;
    height: 36px;
    z-index: 2;
    pointer-events: none;
}

.reel-top { top: 0; background: linear-gradient(to bottom, rgba(255,255,255,0.95), transparent); }
.reel-bottom { bottom: 0; background: linear-gradient(to top, rgba(255,255,255,0.95), transparent); }

.inspiration-reel { will-change: transform; }

.reel-item {
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    color: #111;
    letter-spacing: -0.5px;
    user-select: none;
}

.space-hint {
    font-size: 12px;
    color: #999;
    margin-bottom: 24px;
    font-weight: 500;
}

/* 팔레트 */
.inspiration-palette { min-height: 50px; }

.palette-name-label {
    font-size: 17px;
    font-weight: 700;
    color: #111;
    margin-bottom: 18px;
    letter-spacing: -0.3px;
}

.palette-colors-row {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    overflow: visible;
}

.palette-color {
    width: 82px;
    height: 82px;
    border-radius: 16px;
    cursor: pointer;
    position: relative;
    overflow: visible;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 4px 16px rgba(0,0,0,0.14);
    border: 2px solid rgba(255,255,255,0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    touch-action: manipulation;
}

.palette-color:hover, .palette-color:active {
    transform: scale(1.1) translateY(-5px);
    box-shadow: 0 10px 26px rgba(0,0,0,0.2);
}

/* 호버 툴팁 */
.palette-color-tooltip {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    background: rgba(20,20,20,0.92);
    color: #fff;
    padding: 9px 13px;
    border-radius: 10px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 30;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.palette-color-tooltip::after {
    content: '';
    position: absolute;
    top: 100%; left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: rgba(20,20,20,0.92);
}

.palette-color:hover .palette-color-tooltip {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.pal-name { font-size: 12px; font-weight: 700; }
.pal-hex  { font-size: 10px; font-family: 'Monaco', monospace; opacity: 0.75; }
.pal-desc { font-size: 10px; opacity: 0.6; margin-top: 2px; }

/* 모바일 팔레트 라벨 (tooltip 대신 항상 표시) */
.palette-mobile-label {
    font-size: 9px;
    font-weight: 600;
    color: rgba(255,255,255,0.9);
    background: rgba(0,0,0,0.4);
    padding: 2px 6px;
    border-radius: 4px;
    margin-bottom: 5px;
    display: none;
    max-width: 72px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    backdrop-filter: blur(4px);
}

/* ─── Today's Pick Card ──────────────────── */
.inspo-tab {
    overflow: hidden;
    padding: 0;
}

.inspo-card {
    height: calc(100dvh - 60px);
    background: #000;
    display: flex;
    align-items: stretch;
    position: relative;
    overflow: hidden;
    animation: inspoFade 0.4s ease;
}

@keyframes inspoFade {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.inspo-card.inspo-anim {
    animation: inspoSlide 0.32s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes inspoSlide {
    from { opacity: 0; transform: translateX(24px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* Nav buttons */
.inspo-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.18);
    color: #fff;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    touch-action: manipulation;
    backdrop-filter: blur(6px);
}

.inspo-nav-btn:hover { background: rgba(255,255,255,0.22); }
.inspo-nav-btn:active { transform: translateY(-50%) scale(0.93); }

.inspo-prev { left: 18px; }
.inspo-next { right: 18px; }

/* Text section */
.inspo-text {
    flex: 0 0 42%;
    padding: 60px 52px 60px 80px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    color: #fff;
    position: relative;
    z-index: 2;
}

.inspo-number {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 20px;
}

.inspo-category {
    font-size: 13px;
    color: rgba(255,255,255,0.55);
    margin-bottom: 10px;
    letter-spacing: 0.01em;
    line-height: 1.5;
}

.inspo-title {
    font-size: clamp(32px, 4vw, 56px);
    font-weight: 800;
    color: #fff;
    letter-spacing: -1px;
    line-height: 1.05;
    margin-bottom: 20px;
}

.inspo-desc {
    font-size: 14px;
    color: rgba(255,255,255,0.6);
    line-height: 1.75;
    white-space: pre-line;
}

/* Swatches section */
.inspo-swatches {
    flex: 1;
    position: relative;
    overflow: hidden;
}

.inspo-swatch {
    position: absolute;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding: 24px 28px;
    cursor: pointer;
    transition: filter 0.2s ease, transform 0.2s ease;
    border-radius: 20px 0 0 20px;
}

.inspo-swatch:hover { filter: brightness(1.08); }
.inspo-swatch:active { transform: scale(0.98); }

/* Back card — upper right (secondary color) */
.swatch-back {
    top: 6%;
    right: 0;
    left: 22%;
    bottom: 40%;
    z-index: 1;
    border-radius: 16px 0 0 16px;
}

/* Front card — lower left (primary color), bleeds to bottom */
.swatch-front {
    top: 38%;
    right: 0;
    left: 8%;
    bottom: 0;
    z-index: 2;
    border-radius: 16px 0 0 0;
}

.sw-name {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 5px;
}

.sw-hex {
    font-size: 13px;
    font-family: 'Monaco', 'Courier New', monospace;
    opacity: 0.8;
}

/* ─── Color Library ───────────────────────────── */
.colors-wrapper {
    padding: 36px 0;
}

.colors-wrapper h2 {
    font-size: 24px;
    font-weight: 700;
    color: #111;
    margin-bottom: 6px;
    text-align: center;
}

.colors-subtitle {
    font-size: 13px;
    color: #999;
    margin-bottom: 28px;
    text-align: center;
}

.color-library-container {
    max-height: calc(100dvh - 200px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.color-library {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.color-category-section {
    padding: 24px 0;
    border-bottom: 1px solid rgba(0,0,0,0.06);
}

.color-category-section:last-child { border-bottom: none; }

.color-category-title {
    font-size: 14px;
    font-weight: 700;
    color: #111;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 7px;
    letter-spacing: -0.2px;
}

.cat-icon { font-size: 15px; }

.color-category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 14px;
}

.color-library-item {
    display: flex;
    flex-direction: column;
    gap: 7px;
    cursor: pointer;
    transition: all 0.2s ease;
    touch-action: manipulation;
}

.color-library-box {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
}

.color-library-item:hover .color-library-box,
.color-library-item:active .color-library-box {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.color-library-info-popup {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.78);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.color-library-box:hover .color-library-info-popup { opacity: 1; }

.color-library-hex { font-size: 10px; font-weight: 700; color: #fff; font-family: 'Monaco', monospace; }
.color-library-name { font-size: 10px; font-weight: 600; color: #444; text-align: center; word-break: break-word; line-height: 1.3; }

/* ─── Toast ───────────────────────────────────── */
.toast {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    padding: 11px 20px;
    background: #111;
    color: #fff;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    opacity: 0;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    z-index: 9999;
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
    white-space: nowrap;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ─── Scrollbar ───────────────────────────────── */
::-webkit-scrollbar          { width: 5px; }
::-webkit-scrollbar-track    { background: transparent; }
::-webkit-scrollbar-thumb    { background: rgba(0,0,0,0.15); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.25); }

/* ═══════════════════════════════════════════════
   MOBILE
═══════════════════════════════════════════════ */
@media (max-width: 768px) {
    .navbar {
        padding: 0 16px;
        height: 54px;
    }

    .nav-brand { font-size: 15px; }
    .nav-tab { font-size: 12px; padding: 6px 10px; }

    .tab-content { height: calc(100dvh - 54px); }

    .wrapper { padding: 20px 16px 40px; }

    /* main 세로 */
    .main {
        flex-direction: column;
        gap: 16px;
        margin-bottom: 20px;
    }

    /* 색상 박스 */
    .color-box {
        width: 100%;
        height: 180px;
        border-radius: 18px;
    }

    /* info panel */
    .info-panel { padding: 16px; gap: 12px; }

    .rgb-value { font-size: 28px; min-width: 44px; }

    .code-value { font-size: 16px; }

    /* 모바일 미세조정 보임 */
    .mobile-adjust { display: block; }

    /* 키보드 가이드 숨김 */
    .desktop-only { display: none !important; }

    /* 패밀리 칩 작게 */
    .family-chip { font-size: 12px; padding: 6px 12px; }

    /* 비슷한 색 — 이름 라벨 표시 */
    .similar-color-label { display: block; }

    .similar-color-item { width: 48px; height: 48px; }

    /* 팔레트 색 모바일 라벨 */
    .palette-mobile-label { display: block; }

    .palette-color { width: 72px; height: 72px; border-radius: 14px; }

    .reel-item { font-size: 20px; }

    .inspiration-wrapper { padding: 24px 0; }
    .inspiration-wrapper h2 { font-size: 22px; }

    /* inspo card mobile — vertical stack */
    .inspo-card {
        height: calc(100dvh - 54px);
        flex-direction: column;
    }

    .inspo-text {
        flex: 0 0 auto;
        padding: 48px 24px 20px 24px;
    }

    .inspo-title { font-size: clamp(26px, 8vw, 40px); }

    .inspo-swatches {
        flex: 1;
        min-height: 0;
    }

    .swatch-back {
        top: 4%;
        left: 15%;
        right: 0;
        bottom: 45%;
    }

    .swatch-front {
        top: 42%;
        left: 5%;
        right: 0;
        bottom: 0;
    }

    .inspo-prev { left: 12px; }
    .inspo-next { right: 12px; }

    .sw-name { font-size: 15px; }
    .sw-hex  { font-size: 11px; }

    .colors-wrapper { padding: 20px 0; }
    .color-library-container { max-height: calc(100dvh - 160px); }
    .color-category-grid { grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); gap: 10px; }
    .color-library-name { font-size: 9px; }
}

@media (max-width: 400px) {
    .nav-tab { font-size: 11px; padding: 5px 8px; }
    .rgb-value { font-size: 24px; }
    .color-box { height: 150px; }
    .family-chips { gap: 6px; }
    .family-chip { font-size: 11px; padding: 5px 10px; }
    .palette-color { width: 62px; height: 62px; }
    .adj-btn { font-size: 13px; }
}
