:root {
    --bg-color: #fcfbf9;
    --text-color: #2c2c2a;
    --primary: #4a5c40;
    --primary-hover: #3a4832;
    --secondary-bg: #f2f0e9;
    --border-color: #dfdcd3;
    --warning: #c25e5e;
    --success: #5c744f;
    --font-stack: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-stack);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

header {
    border-bottom: 1px solid var(--border-color);
    padding: 1.5rem 0;
    background: #fff;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

h1 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.03em;
}

nav a {
    color: var(--text-color);
    text-decoration: none;
    margin-left: 1.5rem;
    font-size: 0.95rem;
}

nav a:hover {
    text-decoration: underline;
}

main {
    flex: 1;
    padding: 3rem 1.5rem;
}

section {
    margin-bottom: 3.5rem;
}

.intro-section h2 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.calculator-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

@media (max-width: 768px) {
    .calculator-layout {
        grid-template-columns: 1fr;
    }
}

.audit-panel, .results-panel {
    background: #fff;
    padding: 2rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.audit-panel h3, .results-panel h3 {
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.form-group {
    margin-bottom: 1.2rem;
}

.form-row {
    display: flex;
    gap: 1rem;
}

.form-row .form-group {
    flex: 1;
}

label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
}

input[type="text"], input[type="number"] {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: inherit;
    font-size: 1rem;
}

input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(74, 92, 64, 0.2);
}

small {
    display: block;
    color: #666;
    margin-top: 0.3rem;
    font-size: 0.8rem;
}

button {
    cursor: pointer;
    font-family: inherit;
    font-size: 1rem;
    border-radius: 4px;
    padding: 0.75rem 1.5rem;
    border: none;
    font-weight: 600;
    transition: background 0.2s;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    width: 100%;
    margin-bottom: 1rem;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-secondary {
    background: var(--secondary-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.btn-secondary:hover {
    background: #e6e3da;
}

.btn-text {
    background: transparent;
    color: var(--primary);
    text-decoration: underline;
    padding: 0;
    font-size: 0.9rem;
    font-weight: normal;
    display: block;
    text-align: center;
    width: 100%;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: 400px;
    overflow-y: auto;
}

.history-item {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    padding: 1rem;
    border-radius: 4px;
}

.history-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.history-item-title {
    font-weight: 600;
}

.history-item-cpw {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--success);
}

.history-item-details {
    font-size: 0.85rem;
    color: #666;
    display: flex;
    justify-content: space-between;
}

.remove-btn {
    background: none;
    border: none;
    color: var(--warning);
    font-size: 0.8rem;
    cursor: pointer;
    padding: 0;
    margin-top: 0.5rem;
    text-decoration: underline;
}

.empty-state {
    text-align: center;
    color: #666;
    padding: 2rem 0;
    font-size: 0.9rem;
}

.history-actions {
    margin-top: 1.5rem;
    text-align: right;
}

.content-section h2, .content-section h3 {
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.content-section p, .content-section ul, .content-section ol {
    margin-bottom: 1.2rem;
}

.content-section ul, .content-section ol {
    padding-left: 1.5rem;
}

.content-section li {
    margin-bottom: 0.5rem;
}

.comparison-table-wrapper {
    overflow-x: auto;
    margin: 2rem 0;
}

.comparison-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

.comparison-table th, .comparison-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.comparison-table th {
    background: var(--secondary-bg);
    font-weight: 600;
}

footer {
    text-align: center;
    padding: 2rem 0;
    border-top: 1px solid var(--border-color);
    background: #fff;
    font-size: 0.9rem;
    color: #666;
}

footer nav {
    margin-top: 0.5rem;
}


/* Factory-injected deployment helpers. The AI owns the site design above this block. */
.ad-unit {
  width: min(100%, 720px);
  min-height: 120px;
  margin: 24px auto;
  display: block;
}

.legal-page {
  width: min(900px, calc(100% - 32px));
  margin: 40px auto;
}

.factory-fallback-nav {
  width: min(900px, calc(100% - 32px));
  margin: 24px auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  font-size: 0.95rem;
}

.factory-fallback-nav a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}
