:root {
    --fg: #171717;
    --bg: #ffffff;
    --border: rgba(0, 0, 0, 0.12);
    --muted: rgba(0, 0, 0, 0.6);
    --accent-bg: rgba(0, 0, 0, 0.05);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: -apple-system, "Segoe UI", Arial, Helvetica, sans-serif;
    color: var(--fg);
    background: var(--bg);
}

.site-header {
    border-bottom: 1px solid var(--border);
}

.site-nav {
    max-width: 720px;
    margin: 0 auto;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    font-weight: 600;
    text-decoration: none;
    color: var(--fg);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.9rem;
}

.nav-links a {
    color: var(--fg);
    text-decoration: none;
}

.link-button {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    color: var(--fg);
    cursor: pointer;
}

.inline-form {
    display: inline;
}

.container {
    max-width: 720px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.container.narrow {
    max-width: 480px;
}

.button {
    display: inline-block;
    background: var(--fg);
    color: var(--bg);
    border: none;
    border-radius: 6px;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
}

.button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.stacked-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 360px;
}

.stacked-form label {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.9rem;
}

input[type="email"], input[type="password"], input[type="date"], input[type="text"], input[type="number"] {
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    font-size: 0.95rem;
}

.error {
    color: #b91c1c;
    font-size: 0.85rem;
}

.notice {
    background: var(--accent-bg);
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.9rem;
}

.balance {
    font-size: 2rem;
    font-weight: 600;
    margin-top: 0.5rem;
}

.bundle-form {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.bundle-form .button {
    background: var(--bg);
    color: var(--fg);
    border: 1px solid var(--border);
}

.agent-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.agent-card {
    display: flex;
    gap: 1rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1rem;
    text-decoration: none;
    color: var(--fg);
}

.agent-card img {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.agent-card-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.agent-name {
    font-weight: 600;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.status-dot.online {
    background: #22c55e;
}

.status-dot.offline {
    background: #9ca3af;
}

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

.skills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-top: 0.5rem;
}

.skill-tag {
    background: var(--accent-bg);
    border-radius: 999px;
    padding: 0.1rem 0.6rem;
    font-size: 0.75rem;
}

.chat-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

.chat-messages {
    min-height: 16rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.chat-bubble {
    max-width: 80%;
    border-radius: 10px;
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
}

.chat-bubble.outbound {
    align-self: flex-end;
    background: var(--fg);
    color: var(--bg);
}

.chat-bubble.inbound {
    align-self: flex-start;
    background: var(--accent-bg);
}

#chat-send-form {
    display: flex;
    gap: 0.5rem;
}

#chat-input {
    flex: 1;
}
