:root {
    --bg-1: #431407;
    --bg-2: #9a3412;
    --bg-3: #fdba74;
    --panel: rgba(255, 250, 245, 0.94);
    --panel-soft: rgba(255, 247, 237, 0.92);
    --ink: #0f172a;
    --muted: #64748b;
    --line: rgba(15, 23, 42, 0.08);
    --accent: #b45309;
    --accent-2: #9a3412;
    --accent-soft: rgba(180, 83, 9, 0.12);
    --danger: #ef4444;
    --radius-xl: 28px;
    --radius-lg: 22px;
    --radius-md: 16px;
    --shadow: 0 30px 80px rgba(124, 45, 18, 0.22);
}

*,
::before,
::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    font-family: "Avenir Next", "Segoe UI", sans-serif;
    color: var(--ink);
    background:
        radial-gradient(circle at top left, rgba(251, 146, 60, 0.28), transparent 30%),
        linear-gradient(135deg, var(--bg-1), var(--bg-2) 48%, var(--bg-3));
}

button,
input,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

.container {
    display: grid;
    grid-template-areas:
        "header-left header-right"
        "sidebar chat-menu";
    grid-template-columns: 360px 1fr;
    grid-template-rows: auto 1fr;
    gap: 1rem;
    min-height: calc(100vh - 2rem);
    max-width: 1400px;
    margin: 1rem auto;
    padding: 1rem;
}

.header-left,
.header-right,
.sidebar,
.chat-menu {
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    backdrop-filter: blur(20px);
}

.header-left,
.header-right,
.sidebar {
    background: var(--panel);
}

.chat-menu {
    background: linear-gradient(180deg, rgba(255, 250, 245, 0.92), rgba(255, 237, 213, 0.86));
}

.text-color-primary {
    color: #fff7ed;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.tool-btn,
.btn-add,
.chat-btn,
.send-btn {
    border: none;
    border-radius: 999px;
    transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.tool-btn:hover,
.btn-add:hover,
.chat-btn:hover,
.send-btn:hover {
    transform: translateY(-1px);
}

.tool-btn:disabled,
.send-btn:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.network-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 100px;
    padding: 0.65rem 0.9rem;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 700;
    color: #fff7ed;
    background: rgba(180, 83, 9, 0.94);
}

.network-pill.offline {
    background: rgba(239, 68, 68, 0.9);
}

.tool-btn {
    padding: 0.7rem 1rem;
    color: white;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.tool-btn.secondary {
    color: var(--accent-2);
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(180, 83, 9, 0.2);
}

.btn-add {
    padding: 0.75rem 1rem;
    color: white;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.btn-delete {
    position: relative;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.14);
}

.btn-delete::before,
.btn-delete::after {
    content: "";
    position: absolute;
    inset: 50% auto auto 50%;
    width: 18px;
    height: 2px;
    background: var(--danger);
    transform-origin: center;
}

.btn-delete::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.btn-delete::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

@media (max-width: 980px) {
    .container {
        grid-template-areas:
            "header-left"
            "sidebar"
            "header-right"
            "chat-menu";
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .container {
        margin: 0;
        min-height: 100vh;
        padding: 0.75rem;
    }

    .header-left,
    .header-right,
    .sidebar,
    .chat-menu {
        border-radius: 24px;
    }
}
