* { box-sizing: border-box; }

:root {
    --hgv-teal: #0d6e6e;
    --hgv-blue: #1565c0;
    --hgv-gradient: linear-gradient(135deg, #0b5d52 0%, #0f7a73 35%, #1565c0 100%);
    --ink: #1f2430;
    --muted: #5b6270;
    --card-bg: #ffffff;
    --border: #e3e7ea;
}

html, body {
    min-height: 100vh;
}

body {
    font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    background: var(--hgv-gradient);
    background-attachment: fixed;
    color: var(--ink);
    margin: 0;
    padding: 0;
}

.container {
    max-width: 860px;
    margin: 0 auto;
    padding: 48px 20px 80px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 28px;
}

.brand-logo {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: linear-gradient(135deg, #0d6e6e, #1565c0);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 800;
    font-size: 18px;
    letter-spacing: 0.02em;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
    flex-shrink: 0;
}

.brand-text h1 {
    color: #fff;
    font-size: 22px;
    margin: 0;
    font-weight: 700;
}

.brand-text .subtitle {
    color: rgba(255, 255, 255, 0.85);
    font-size: 13.5px;
    margin: 2px 0 0;
}

#search-form {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    margin: 0 0 24px;
    box-shadow: 0 12px 30px rgba(8, 35, 48, 0.18);
}

#query {
    width: 100%;
    border: 1px solid #d7dadf;
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 15px;
    resize: vertical;
    font-family: inherit;
}

#query:focus {
    outline: none;
    border-color: var(--hgv-blue);
    box-shadow: 0 0 0 3px rgba(21, 101, 192, 0.12);
}

.actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 14px;
}

.refresh-toggle {
    font-size: 13px;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

button#btn-search {
    background: linear-gradient(135deg, #0d6e6e, #1565c0);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 11px 24px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: filter 0.15s ease, transform 0.05s ease;
}

button#btn-search:hover { filter: brightness(1.08); }
button#btn-search:active { transform: translateY(1px); }

button#btn-search:disabled {
    opacity: 0.6;
    cursor: default;
}

.status {
    font-size: 13.5px;
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 10px;
    padding: 10px 14px;
    margin-bottom: 18px;
}

.hidden { display: none !important; }

.answer-box {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-left: 4px solid var(--hgv-teal);
    border-radius: 14px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 10px 24px rgba(8, 35, 48, 0.12);
}

.answer-box h2 {
    font-size: 13px;
    margin: 0 0 10px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
}

#answer-text {
    font-size: 15px;
    line-height: 1.55;
    white-space: pre-wrap;
}

.meta {
    margin-top: 12px;
    font-size: 12px;
    color: #8a8f99;
}

.raw-results {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 18px;
    margin-bottom: 20px;
    overflow-x: auto;
    box-shadow: 0 10px 24px rgba(8, 35, 48, 0.12);
}

.raw-results h3 {
    margin-top: 0;
    font-size: 14px;
    color: var(--ink);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

th, td {
    text-align: left;
    padding: 9px 10px;
    border-bottom: 1px solid #eceef1;
}

th {
    color: var(--muted);
    font-weight: 600;
    background: #f6f8f9;
}

tr:hover td { background: #f9fbfb; }

.history {
    background: rgba(255, 255, 255, 0.92);
    border-radius: 14px;
    padding: 16px 18px;
    box-shadow: 0 10px 24px rgba(8, 35, 48, 0.12);
}

.history h3 {
    font-size: 14px;
    color: var(--ink);
    margin-top: 0;
}

#history-list {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 13px;
}

#history-list li {
    padding: 9px 0;
    border-bottom: 1px solid #eceef1;
    color: #3a3f49;
}

#history-list li:last-child { border-bottom: none; }

#history-list li span {
    color: #8a8f99;
    margin-left: 6px;
}

@media (max-width: 480px) {
    .actions { flex-direction: column; align-items: stretch; gap: 12px; }
    button#btn-search { width: 100%; }
}
