/* Reset and base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --primary: #e07a5f;
    --primary-dark: #c06045;
    --secondary: #3d405b;
    --accent: #81b29a;
    --bg: #f4f1de;
    --card-bg: #ffffff;
    --text: #2b2b2b;
    --text-light: #5e5e5e;
    --border: #e0e0e0;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    --radius: 12px;
}

body {
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    background: var(--card-bg);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    text-decoration: none;
    color: var(--secondary);
}

nav ul {
    list-style: none;
    display: flex;
    gap: 1.5rem;
}

nav a {
    text-decoration: none;
    color: var(--text-light);
    font-weight: 500;
    transition: color 0.2s;
}

nav a:hover, nav a.active {
    color: var(--primary-dark);
}

/* Hero */
.hero {
    background: linear-gradient(135deg, #e07a5f 0%, #f2cc8f 100%);
    color: white;
    padding: 3rem 0;
    text-align: center;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* Calculator Section */
.calculator-section {
    padding: 3rem 0;
}

.calculator-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 2rem;
    max-width: 500px;
    margin: 0 auto;
}

.calculator-card h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--secondary);
}

.input-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--secondary);
}

input[type="number"] {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

input[type="number"]:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(224, 122, 95, 0.2);
}

.tip-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tip-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    background: white;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

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

.tip-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

#tipCustom {
    width: 100px;
    padding: 0.5rem;
}

.results {
    background: var(--bg);
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1.5rem;
}

.result-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
}

.result-item:last-child {
    margin-bottom: 0;
}

.result-item.highlight {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-dark);
    border-top: 1px solid var(--border);
    padding-top: 0.75rem;
}

/* Info Sections */
.info-section {
    padding: 3rem 0;
    background: var(--card-bg);
}

.info-section h2 {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--secondary);
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.info-card {
    background: var(--bg);
    padding: 1.5rem;
    border-radius: var(--radius);
    text-align: center;
}

.info-card h3 {
    color: var(--secondary);
    margin-bottom: 0.5rem;
}

.tips-section {
    padding: 3rem 0;
}

.tips-section h2 {
    color: var(--secondary);
    margin-bottom: 1rem;
}

.tips-section ul {
    list-style: disc;
    margin-left: 1.5rem;
    margin-top: 1rem;
}

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

/* Footer */
footer {
    background: var(--secondary);
    color: white;
    padding: 1.5rem 0;
    margin-top: auto;
    text-align: center;
}

footer nav a {
    color: var(--accent);
    text-decoration: none;
}

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

/* Responsive */
@media (max-width: 600px) {
    .header-content {
        flex-direction: column;
        gap: 0.5rem;
    }
    nav ul {
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
    }
    .hero h1 {
        font-size: 2rem;
    }
    .calculator-card {
        padding: 1.5rem;
    }
}

/* Ad slot styling */
.ad-slot {
    text-align: center;
    margin: 2rem 0;
}



/* 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;
}
