:root {
    --bg: #f0f2f5;
    --text: #222;
    --card-bg: #fff;
    --card-border: #e0e0e0;
    --primary: #0b3d0b;
    --primary-hover: #072b07;
}

body.dark {
    --bg: #121212;
    --text: #e6e6e6;
    --card-bg: #1e1e1e;
    --card-border: #333;
    --primary: #145214;
    --primary-hover: #0f3f0f;
}

body {
    margin: 0;
    font-family: Calibri, "Segoe UI", Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    transition: background 0.3s, color 0.3s;
}

* {
    box-sizing: border-box;
}

header {
    background: var(--primary);
    padding: 20px;
    text-align: center;
    color: white;
    font-size: 32px;
    font-weight: 700;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    position: relative;
}

.site-header {
    background: var(--primary);
    padding: 20px;
    text-align: center;
    color: white;
    font-size: 32px;
    font-weight: 700;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    position: relative;
}

.brand-title {
    font-family: Calibri, "Segoe UI", Arial, sans-serif;
    font-size: 32px;
    font-weight: 700;
    color: white;
}

.home-link {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.4);
    background: rgba(255,255,255,0.12);
}

.home-link:hover {
    background: rgba(255,255,255,0.2);
}

.page-shell {
    max-width: 980px;
    margin: 40px auto;
    padding: 0 16px;
}

#toggle {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 50%;
    border: none;
    color: #145214;
    background: rgba(255,255,255,0.95);
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    z-index: 2000;
    box-shadow: 0 6px 18px rgba(0,0,0,0.12);
}

#toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(0,0,0,0.16);
}

#container {
    max-width: 800px;
    margin: 40px auto;
    background: var(--card-bg);
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    border: 1px solid var(--card-border);
    transition: background 0.3s, border 0.3s;
}

h2 {
    margin-top: 30px;
    color: var(--text);
}

.input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

input {
    flex: 1;
    padding: 14px;
    font-size: 16px;
    border-radius: 10px;
    border: 1px solid #ccc;
    background: #fafafa;
}

body.dark input {
    background: #2a2a2a;
    border: 1px solid #444;
    color: var(--text);
}

button {
    width: 100%;
    padding: 14px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 18px;
    cursor: pointer;
    margin-top: 10px;
    transition: 0.2s;
}

button:hover {
    background: var(--primary-hover);
}

.card {
    background: var(--card-bg);
    padding: 20px;
    margin-top: 15px;
    border-radius: 14px;
    border: 1px solid var(--card-border);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: background 0.3s, border 0.3s;
}

.bill-kind-tag {
    display: inline-flex;
    align-items: center;
    margin-left: 8px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    text-transform: lowercase;
    letter-spacing: 0.25px;
    vertical-align: middle;
}

.bill-kind-amendment {
    background: #e7f7ec;
    color: #166c2d;
    border: 1px solid #a9ddb9;
}

.summary-block {
    margin-top: 12px;
    padding: 14px 16px;
    border-left: 4px solid var(--primary);
    border-radius: 10px;
    background: rgba(34, 139, 34, 0.12);
    line-height: 1.5;
}

body.dark .summary-block {
    background: rgba(58, 157, 58, 0.18);
}

.summary-heading {
    margin: 0 0 8px 0;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--primary);
}

.summary-section {
    margin-top: 8px;
}

.official-text-row {
    margin: 14px 0 10px;
    font-size: 18px;
    font-weight: 700;
}

.official-text-row a {
    font-weight: 700;
}

.clickable {
    color: var(--primary);
    cursor: pointer;
    font-weight: 600;
}

.clickable:hover {
    text-decoration: underline;
}

.spinner-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 18px 0;
    opacity: 0;
    animation: fadeIn 220ms ease forwards;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(0,0,0,0.08);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 260ms ease;
}
