:root {
    --primary: #0f766e;
    --primary-hover: #115e59;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #334155;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --danger: #ef4444;
    --font-sans: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

body {
    font-family: var(--font-sans);
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
}

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

h1, h2, h3 { color: #0f172a; margin-bottom: 1rem; }

.site-header {
    background: var(--primary);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 1.25rem;
}
.site-header nav a {
    color: white;
    text-decoration: none;
    margin-left: 1.5rem;
    font-size: 0.95rem;
}
.site-header nav a:hover { text-decoration: underline; }

main { padding: 3rem 0; }

.hero-section { margin-bottom: 3rem; text-align: center; }
.hero-section h1 { font-size: 2.5rem; }
.lead { font-size: 1.125rem; color: var(--text-muted); max-width: 700px; margin: 0 auto; }

.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
}

hr { border: 0; border-top: 1px solid var(--border); margin: 2rem 0; }

.form-group { margin-bottom: 1.5rem; }
.form-group label { display: block; font-weight: 600; margin-bottom: 0.5rem; }
.form-group small { display: block; color: var(--text-muted); font-size: 0.85rem; margin-top: 0.25rem; }

input[type="number"], input[type="text"] {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    font-family: var(--font-sans);
    font-size: 1rem;
}
.input-large { max-width: 200px; }

.input-row {
    display: grid;
    grid-template-columns: 2fr 1fr auto;
    gap: 1rem;
    align-items: end;
}
.col label { display: block; font-size: 0.9rem; font-weight: 600; margin-bottom: 0.25rem; }

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 1rem;
}
.btn-primary {
    background: var(--primary);
    color: white;
}
.btn-primary:hover { background: var(--primary-hover); }

.results-area { margin-top: 2rem; }
.list-header {
    display: flex;
    justify-content: space-between;
    font-weight: 600;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border);
    margin-bottom: 1rem;
}

.med-list { list-style: none; }
.med-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
}
.med-item-info strong { display: block; color: var(--primary); }
.med-item-info span { font-size: 0.9rem; color: var(--text-muted); }
.med-item-count {
    font-size: 1.25rem;
    font-weight: 700;
    background: #f1f5f9;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}
.delete-btn {
    background: none;
    border: none;
    color: var(--danger);
    cursor: pointer;
    font-size: 0.85rem;
}
.delete-btn:hover { text-decoration: underline; }

.empty-state { text-align: center; color: var(--text-muted); padding: 2rem; font-style: italic; }

.task-list { list-style: none; margin-top: 1rem; }
.task-list li { margin-bottom: 1rem; }
.checkbox-label {
    display: flex;
    gap: 0.75rem;
    cursor: pointer;
    align-items: flex-start;
    line-height: 1.4;
}
.checkbox-label input { margin-top: 0.2rem; transform: scale(1.2); }

.guide-section { padding: 2rem; background: white; border-radius: 0.75rem; border: 1px solid var(--border); }
.guide-section p { margin-bottom: 1.5rem; }
.guide-section h3 { margin-top: 2rem; }

footer {
    text-align: center;
    padding: 3rem 0;
    color: var(--text-muted);
    font-size: 0.9rem;
    border-top: 1px solid var(--border);
    margin-top: 3rem;
}
footer nav { margin-top: 1rem; }
footer nav a {
    color: var(--primary);
    text-decoration: none;
    margin: 0 0.5rem;
}

@media (max-width: 600px) {
    .input-row {
        grid-template-columns: 1fr;
    }
    .btn { width: 100%; }
}


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