:root {
    --bg: #f4f6f9;
    --card-bg: #ffffff;
    --text: #1a1a2e;
    --text-secondary: #4a4a6a;
    --border: #e2e8f0;
    --shadow: 0 8px 24px rgba(0,0,0,0.06);
    --font: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

[data-theme="dark"] {
    --bg: #0f1117;
    --card-bg: #1c1e26;
    --text: #e4e6f0;
    --text-secondary: #a0a4b8;
    --border: #2e3140;
    --shadow: 0 8px 24px rgba(0,0,0,0.4);
}

* { box-sizing: border-box; }

body {
    background: var(--bg);
    margin: 0;
    font-family: var(--font);
    color: var(--text);
    transition: background 0.3s, color 0.3s;
}

.myip-container {
    width: 100%;
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.myip-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.myip-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
}

.myip-card-header h5 {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0;
    color: var(--text);
}

.myip-btn-group {
    display: flex;
    gap: 8px;
}

.myip-icon-btn {
    background: rgba(128,128,128,0.1);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 8px 10px;
    color: var(--text);
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.2s, transform 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.myip-icon-btn:hover {
    background: rgba(128,128,128,0.25);
    transform: translateY(-1px);
}

/* Clean list for IPs */
.myip-clean-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.myip-clean-list > div {
    display: flex;
    flex-direction: row;
    align-items: baseline;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}

.myip-clean-list > div:last-child {
    border-bottom: none;
}

.myip-clean-list span:first-child {
    font-weight: 600;
    color: var(--text);
    font-size: 0.95rem;
    flex: 0 0 25%;
    max-width: 25%;
}

.myip-clean-list span:last-child {
    color: var(--text-secondary);
    font-weight: 500;
    text-align: right;
    word-break: break-word;
    flex: 1;
    font-size: 0.95rem;
}

/* Map */
.myip-map-box {
    height: 350px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
}

/* 4-column details grid */
.myip-details-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.myip-detail-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 8px;
    border-radius: 12px;
    background: rgba(128,128,128,0.03);
    border: 1px solid var(--border);
}

.myip-detail-item .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
    color: var(--text-secondary);
    flex-shrink: 0;
    margin-top: 2px;
}

.myip-detail-content {
    display: flex;
    flex-direction: column;
}

.myip-detail-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    opacity: 0.7;
    margin-bottom: 2px;
}

.myip-detail-value {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
    word-break: break-word;
}

/* Theme toggle */
.myip-theme-toggle {
    text-align: right;
    margin-bottom: 10px;
}

.myip-theme-toggle button {
    background: none;
    border: none;
    color: var(--text);
    cursor: pointer;
    font-size: 1.2rem;
    opacity: 0.7;
    padding: 4px 8px;
    border-radius: 8px;
}

.myip-theme-toggle button:hover {
    opacity: 1;
    background: rgba(128,128,128,0.15);
}

/* QR and Export */
.myip-export-row {
    display: flex;
    align-items: center;
    gap: 20px;
    justify-content: center;
    margin-top: 10px;
    flex-wrap: wrap;
}

.myip-qr img {
    background: white;
    padding: 8px;
    border-radius: 12px;
}

/* Responsive */
@media (max-width: 1000px) {
    .myip-details-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .myip-container {
        margin: 15px auto;
        padding: 0 12px;
        gap: 20px;
    }
    .myip-card {
        padding: 18px;
    }
    .myip-card-header h5 {
        font-size: 1.2rem;
    }
    .myip-map-box {
        height: 220px !important;
    }
    .myip-details-grid {
        grid-template-columns: 1fr;
    }
}