:root {
    --gold-primary: #C9A84C;
    --gold-light: #E8C96A;
    --gold-dark: #9A7A2E;
    --bg-dark: #0F0F0F;
    --bg-card-dark: #1A1A1A;
    --bg-light: #FAFAF8;
    --bg-card-light: #FFFFFF;
    --text-primary: #1A1A1A;
    --text-secondary: #6B7280;
    --success: #16A34A;
    --danger: #DC2626;
    --radius-card: 12px;
    --radius-input: 8px;
    --shadow-soft: 0 1px 3px rgba(0, 0, 0, 0.10);
}

* {
    box-sizing: border-box;
}

html {
    background: var(--bg-light);
}

body {
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.7;
}

img {
    max-width: 100%;
    display: block;
}

a {
    text-decoration: none;
}

.section-card,
.table-card,
.result-panel,
.calculator-card,
.mini-stat,
.field-input,
.btn-primary,
.btn-secondary {
    border-radius: var(--radius-card);
}

.calculator-card {
    width: 100%;
}

.field-group {
    display: grid;
    gap: 0.5rem;
}

.field-group > span {
    font-size: 0.875rem;
    font-weight: 600;
    color: rgb(68 64 60);
}

.dark .field-group > span {
    color: rgb(214 211 209);
}

.field-input {
    width: 100%;
    min-height: 48px;
    border: 1px solid rgb(214 211 209);
    background: #fff;
    color: rgb(28 25 23);
    padding: 0.75rem 0.875rem;
    font-size: 0.95rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

@media (min-width: 768px) {
    .field-input {
        min-height: 44px;
    }
}

.field-input:focus {
    outline: none;
    border-color: var(--gold-primary);
    box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.2);
}

.dark .field-input {
    border-color: rgb(68 64 60);
    background: rgb(28 25 23);
    color: white;
}

.btn-primary,
.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 46px;
    padding: 0.75rem 1.125rem;
    font-size: 0.95rem;
    font-weight: 700;
    transition: transform 0.2s ease, opacity 0.2s ease, border-color 0.2s ease;
}

.btn-primary:hover,
.btn-secondary:hover {
    transform: translateY(-1px);
}

.btn-primary {
    color: #fff;
    background-image: linear-gradient(135deg, var(--gold-primary), var(--gold-dark));
    box-shadow: var(--shadow-soft);
}

.btn-secondary {
    color: rgb(41 37 36);
    border: 1px solid rgb(214 211 209);
    background: #fff;
}

.dark .btn-secondary {
    color: #fff;
    border-color: rgb(68 64 60);
    background: rgb(28 25 23);
}

.result-panel {
    border: 1px solid rgba(201, 168, 76, 0.25);
    background: linear-gradient(135deg, rgba(201, 168, 76, 0.12), rgba(255, 255, 255, 0.95));
    padding: 1.5rem;
    box-shadow: var(--shadow-soft);
}

.dark .result-panel {
    background: linear-gradient(135deg, rgba(201, 168, 76, 0.12), rgba(17, 24, 39, 0.92));
}

.result-panel.compact {
    padding: 1rem 1.25rem;
}

.mini-stat {
    border: 1px solid rgb(231 229 228);
    background: rgba(255, 255, 255, 0.72);
    padding: 0.9rem 1rem;
}

.dark .mini-stat {
    border-color: rgb(68 64 60);
    background: rgba(17, 24, 39, 0.65);
}

.mini-stat span {
    display: block;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgb(120 113 108);
}

.mini-stat strong {
    display: block;
    margin-top: 0.3rem;
    font-size: 1rem;
    color: rgb(28 25 23);
}

.dark .mini-stat strong {
    color: white;
}

.prose code {
    font-weight: 600;
}

.toast {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 60;
    max-width: 18rem;
    border-radius: 12px;
    background: rgb(28 25 23);
    color: white;
    padding: 0.85rem 1rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.widget-card {
    border-radius: 16px;
    border: 1px solid rgb(229 231 235);
    background: #fff;
    padding: 1rem;
    box-shadow: var(--shadow-soft);
}

.dark .widget-card {
    border-color: rgb(55 65 81);
    background: rgb(17 24 39);
}

.bg-positive {
    color: var(--success);
}

.bg-negative {
    color: var(--danger);
}

pre.embed-code {
    overflow-x: auto;
    border-radius: 16px;
    background: rgb(12 10 9);
    color: rgb(245 245 244);
    padding: 1rem 1.25rem;
}

canvas {
    width: 100%;
}
