/* Base Reset & Variables */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #0f1115;
    --bg-card: #1a1d24;
    --bg-card-hover: #22262f;
    --text: #e8eaed;
    --text-muted: #8b919a;
    --text-dim: #5f646d;
    --border: #2a2f38;
    --online: #4ade80;
    --offline: #f87171;
    --slow: #fbbf24;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-pill: 20px;
}

html {
    font-size: 14px;
    scroll-behavior: smooth;
}

body {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* Container */
.container {
    max-width: 540px;
    margin: 0 auto;
    padding: 12px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    margin-bottom: 16px;
}

.logo {
    margin: 0;
    font-size: inherit;
    font-weight: inherit;
}

.logo-link {
    display: flex;
    align-items: baseline;
    gap: 0;
    text-decoration: none;
    letter-spacing: -0.02em;
}

.logo-text {
    font-size: 1.125rem;
    font-weight: 500;
    color: var(--text-muted);
}

.logo-accent {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text);
}

.header-status {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--bg-card);
    border-radius: var(--radius-pill);
}

.header-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-dim);
    transition: background 0.2s ease;
}

.header-status-dot[data-status="online"] {
    background: var(--online);
}

.header-status-dot[data-status="offline"] {
    background: var(--offline);
}

.header-status-dot[data-status="slow"] {
    background: var(--slow);
}

.header-status-text {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
}


/* Main Content */
.main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Sections */
.section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.section-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text);
    letter-spacing: -0.01em;
}

.status-meta {
    display: flex;
    align-items: center;
    gap: 6px;
}

.last-update {
    font-size: 0.688rem;
    color: var(--text-dim);
}

.refresh-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: var(--bg-card);
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s ease;
}

.refresh-btn:hover {
    background: var(--bg-card-hover);
    color: var(--text);
}

.refresh-btn.loading svg {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.badge {
    font-size: 0.625rem;
    font-weight: 500;
    padding: 3px 8px;
    background: var(--bg-card);
    color: var(--text-muted);
    border-radius: var(--radius-pill);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Bento Grid */
.bento-grid {
    display: grid;
    gap: 8px;
}

.status-grid {
    grid-template-columns: repeat(2, 1fr);
}

.tools-grid {
    grid-template-columns: repeat(2, 1fr);
}

.content-grid {
    grid-template-columns: repeat(2, 1fr);
}

/* Cards */
.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 12px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    transition: background 0.15s ease;
}

.card-main {
    grid-column: span 2;
    padding: 14px;
}

.card-wide {
    grid-column: span 2;
}

.card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    flex-shrink: 0;
}

.card-main .card-icon {
    width: 40px;
    height: 40px;
}

/* Status Icon States */
.status-icon[data-status="online"] {
    background: rgba(74, 222, 128, 0.12);
    color: var(--online);
}

.status-icon[data-status="offline"] {
    background: rgba(248, 113, 113, 0.12);
    color: var(--offline);
}

.status-icon[data-status="slow"] {
    background: rgba(251, 191, 36, 0.12);
    color: var(--slow);
}

.status-icon[data-status="loading"] {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.card-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.card-title {
    font-size: 0.938rem;
    font-weight: 600;
    color: var(--text);
}

.card-status {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.card-label {
    font-size: 0.688rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.card-value {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text);
}

.card-value-large {
    font-size: 1.125rem;
    font-weight: 600;
}

/* Tool Cards */
.card-tool {
    text-decoration: none;
    position: relative;
    cursor: pointer;
}

.card-tool:hover {
    background: var(--bg-card-hover);
}

.tool-icon {
    background: var(--bg);
    color: var(--text-dim);
}

.card-tool:hover .tool-icon {
    color: var(--text-muted);
}

.tool-title {
    font-size: 0.813rem;
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tool-desc {
    font-size: 0.688rem;
    color: var(--text-dim);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tool-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 0.563rem;
    font-weight: 500;
    padding: 2px 6px;
    background: var(--bg);
    color: var(--text-dim);
    border-radius: var(--radius-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Content Sections */
.section-content {
    padding: 16px 0;
}

.section-content .section-title {
    margin-bottom: 10px;
}

.content-text {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.content-text p {
    font-size: 0.813rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.content-text strong {
    color: var(--text);
}

/* Page Content (legal pages) */
.page-content {
    padding: 8px 0;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.page-meta {
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-bottom: 20px;
}

.content-section {
    margin-bottom: 24px;
}

.content-section h2 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 10px;
}

.content-section h3 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text);
    margin: 16px 0 8px;
}

.content-section p {
    font-size: 0.813rem;
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 10px;
}

.content-section a {
    color: var(--text);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.content-section a:hover {
    color: var(--text-muted);
}

.content-list {
    list-style: none;
    margin: 10px 0;
    padding-left: 0;
}

.content-list li {
    font-size: 0.813rem;
    color: var(--text-muted);
    line-height: 1.7;
    padding-left: 16px;
    position: relative;
    margin-bottom: 6px;
}

.content-list li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--text-dim);
}

.content-list strong {
    color: var(--text);
}

.contact-email {
    margin: 8px 0;
}

.contact-email a {
    font-size: 0.938rem;
    font-weight: 500;
    color: var(--text);
    text-decoration: none;
    padding: 10px 16px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    display: inline-block;
    transition: background 0.15s;
}

.contact-email a:hover {
    background: var(--bg-card-hover);
}

/* Tool Placeholder */
.tool-placeholder {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 32px 20px;
    text-align: center;
    margin-bottom: 24px;
}

.placeholder-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    background: var(--bg);
    border-radius: 50%;
    color: var(--text-dim);
    margin-bottom: 16px;
}

.placeholder-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}

.placeholder-text {
    font-size: 0.813rem;
    color: var(--text-muted);
    max-width: 320px;
    margin: 0 auto 16px;
    line-height: 1.6;
}

.placeholder-link {
    display: inline-block;
    font-size: 0.813rem;
    font-weight: 500;
    color: var(--text);
    text-decoration: none;
    padding: 8px 16px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    transition: background 0.15s;
}

.placeholder-link:hover {
    background: var(--bg-card-hover);
}

/* Partners Section */
.section-partners {
    padding: 16px 0 0;
}

.section-partners .section-title {
    font-size: 0.75rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 10px;
}

.partners-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.partner-card {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 12px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: background 0.15s;
}

.partner-card:hover {
    background: var(--bg-card-hover);
}

.partner-name {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text);
}

.partner-desc {
    font-size: 0.625rem;
    color: var(--text-dim);
    line-height: 1.4;
}

@media (min-width: 640px) {
    .partners-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* FAQ */
.faq-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.faq-item {
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.faq-question {
    padding: 12px 14px;
    font-size: 0.813rem;
    font-weight: 500;
    color: var(--text);
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.faq-question::-webkit-details-marker {
    display: none;
}

.faq-question::after {
    content: '+';
    font-size: 1rem;
    color: var(--text-dim);
    transition: transform 0.2s;
}

.faq-item[open] .faq-question::after {
    content: '−';
}

.faq-answer {
    padding: 0 14px 12px;
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.6;
}

/* Footer */
.footer {
    margin-top: 24px;
    padding: 20px 0 12px;
    border-top: 1px solid var(--border);
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px 16px;
    margin-bottom: 20px;
}

.footer-brand {
    grid-column: span 2;
}

.footer-logo {
    font-size: 1rem;
    color: var(--text-muted);
}

.footer-logo strong {
    color: var(--text);
}

.footer-tagline {
    font-size: 0.688rem;
    color: var(--text-dim);
    margin-top: 4px;
}

.footer-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.footer-heading {
    font-size: 0.688rem;
    font-weight: 600;
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.footer-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.footer-links a {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.15s;
}

.footer-links a:hover {
    color: var(--text);
}

.footer-bottom {
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.footer-disclaimer {
    font-size: 0.625rem;
    color: var(--text-dim);
    line-height: 1.5;
    margin-bottom: 8px;
}

.footer-copyright {
    font-size: 0.625rem;
    color: var(--text-dim);
}

/* Desktop footer */
@media (min-width: 640px) {
    .footer-grid {
        grid-template-columns: 2fr 1fr 1fr 1fr;
        gap: 24px;
    }
    
    .footer-brand {
        grid-column: span 1;
    }
}

/* Tablet & Desktop */
@media (min-width: 640px) {
    html {
        font-size: 15px;
    }

    .container {
        max-width: 680px;
        padding: 20px;
    }

    .header {
        margin-bottom: 24px;
    }

    .bento-grid {
        gap: 10px;
    }

    .status-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .card-main {
        grid-column: span 2;
        grid-row: span 2;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        text-align: center;
        padding: 20px;
    }

    .card-main .card-icon {
        width: 48px;
        height: 48px;
    }

    .card-main .card-content {
        align-items: center;
    }

    .card-wide {
        grid-column: span 2;
    }

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

    .card {
        padding: 14px;
    }
}

@media (min-width: 900px) {
    .container {
        max-width: 800px;
        padding: 24px;
    }

    .main {
        gap: 28px;
    }

    .section {
        gap: 12px;
    }

    .status-grid {
        grid-template-columns: repeat(4, 1fr);
    }

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

/* Smooth loading states */
.card-value[data-loading="true"] {
    background: linear-gradient(90deg, var(--bg) 25%, var(--bg-card-hover) 50%, var(--bg) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
    color: transparent;
    min-width: 40px;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Status text colors */
.card-value[data-status="online"] {
    color: var(--online);
}

.card-value[data-status="offline"] {
    color: var(--offline);
}

.card-value[data-status="slow"] {
    color: var(--slow);
}

