/* Thrift Flip Profit Estimator – styles.css */
:root {
  --green-900: #1b4332;
  --green-800: #2d6a4f;
  --green-700: #40916c;
  --green-600: #52b788;
  --green-500: #74c69d;
  --green-300: #95d5b2;
  --green-200: #b7e4c7;
  --green-100: #d8f3dc;
  --green-50: #f0faf3;
  --amber-500: #f59e0b;
  --amber-100: #fef3c7;
  --red-600: #dc2626;
  --red-100: #fee2e2;
  --gray-900: #1a1a1a;
  --gray-800: #2d2d2d;
  --gray-700: #404040;
  --gray-600: #525252;
  --gray-500: #737373;
  --gray-400: #a3a3a3;
  --gray-300: #d4d4d4;
  --gray-200: #e5e5e5;
  --gray-100: #f5f5f5;
  --white: #ffffff;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.06), 0 1px 3px rgba(0,0,0,.1);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,.07), 0 2px 4px -2px rgba(0,0,0,.05);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.08), 0 4px 6px -4px rgba(0,0,0,.04);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --max-width: 1160px;
}

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

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font-sans);
  color: var(--gray-900);
  background: var(--green-50);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--green-800); text-decoration: underline; text-underline-offset: 2px; }
a:hover { color: var(--green-900); }

.container { width: 100%; max-width: var(--max-width); margin: 0 auto; padding: 0 1.25rem; }

.skip-link {
  position: absolute; top: -100%; left: 0;
  background: var(--green-900); color: var(--white);
  padding: .5rem 1rem; z-index: 100; font-size: .875rem;
}
.skip-link:focus { top: 0; }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* Header */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  position: sticky; top: 0; z-index: 50;
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 60px; gap: 1rem;
}
.logo {
  display: flex; align-items: center; gap: .5rem;
  text-decoration: none; color: var(--gray-900); font-weight: 700;
  font-size: 1.125rem; flex-shrink: 0;
}
.logo:hover { color: var(--gray-900); }
.logo-icon { flex-shrink: 0; }
.logo-accent { color: var(--green-700); }

.site-nav {
  display: flex; align-items: center; gap: .25rem;
}
.site-nav a {
  padding: .375rem .75rem; border-radius: var(--radius-sm);
  text-decoration: none; color: var(--gray-700);
  font-size: .875rem; font-weight: 500;
  transition: background .15s, color .15s;
}
.site-nav a:hover,
.site-nav a:focus-visible {
  background: var(--green-100); color: var(--green-900);
}

.nav-toggle {
  display: none;
  background: none; border: none; cursor: pointer;
  width: 36px; height: 36px;
  flex-direction: column; align-items: center; justify-content: center;
  gap: 5px; border-radius: var(--radius-sm);
}
.nav-toggle span {
  display: block; width: 20px; height: 2px;
  background: var(--gray-700); border-radius: 2px;
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: .5rem; padding: .625rem 1.25rem;
  border-radius: var(--radius-sm); font-size: .875rem;
  font-weight: 600; cursor: pointer; border: 2px solid transparent;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
  text-decoration: none; line-height: 1.25;
}
.btn-primary { background: var(--green-800); color: var(--white); }
.btn-primary:hover { background: var(--green-900); color: var(--white); }
.btn-secondary { background: var(--gray-200); color: var(--gray-800); }
.btn-secondary:hover { background: var(--gray-300); }
.btn-outline { background: transparent; border-color: var(--gray-300); color: var(--gray-700); }
.btn-outline:hover { border-color: var(--green-700); color: var(--green-800); }
.btn-text { background: none; border: none; color: var(--green-700); padding: .25rem .5rem; font-weight: 500; }
.btn-text:hover { color: var(--green-900); text-decoration: underline; }
.btn-sm { padding: .375rem .75rem; font-size: .8125rem; }
.btn-lg { padding: .75rem 1.75rem; font-size: 1rem; }

/* Hero */
.hero { padding: 4rem 0 3rem; }
.hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800; line-height: 1.15;
  color: var(--green-900); max-width: 20ch;
}
.hero-sub {
  font-size: 1.125rem; color: var(--gray-600);
  max-width: 50ch; margin: 1rem 0 1.5rem;
}
.hero-stats {
  display: flex; gap: 2rem; margin: 2rem 0;
}
.stat { display: flex; flex-direction: column; }
.stat-num { font-size: 1.25rem; font-weight: 700; color: var(--green-800); }
.stat-label { font-size: .8125rem; color: var(--gray-500); }

/* Sections */
.section { padding: 3.5rem 0; }
.section-heading {
  font-size: 1.625rem; font-weight: 700;
  color: var(--green-900); margin-bottom: .5rem;
}
.section-intro {
  color: var(--gray-600); margin-bottom: 2rem; max-width: 60ch;
}

/* Estimator layout */
.estimator-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 2rem; align-items: start;
}

/* Form */
.estimator-form-wrap {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
}
.form-group {
  border: none; margin-bottom: 1.75rem;
}
.form-legend {
  font-size: .8125rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em;
  color: var(--gray-500); margin-bottom: .75rem;
}

.preset-grid {
  display: flex; flex-wrap: wrap; gap: .5rem;
}
.preset-btn {
  display: inline-flex; align-items: center; gap: .375rem;
  padding: .5rem 1rem; border-radius: 999px;
  border: 2px solid var(--gray-200); background: var(--white);
  font-size: .875rem; font-weight: 500; cursor: pointer;
  color: var(--gray-700); transition: all .15s;
}
.preset-btn:hover { border-color: var(--green-600); color: var(--green-800); }
.preset-btn.active {
  border-color: var(--green-800); background: var(--green-100);
  color: var(--green-900);
}
.preset-icon { font-size: 1.1em; }

.input-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.input-wrap { display: flex; flex-direction: column; gap: .25rem; }
.input-wrap:has(.input-sm) { gap: .375rem; }
.input-label {
  font-size: .8125rem; font-weight: 600;
  color: var(--gray-700);
}
.opt { font-weight: 400; color: var(--gray-400); }

.input-prefix,
.input-suffix {
  display: flex; align-items: center;
  border: 2px solid var(--gray-300); border-radius: var(--radius-sm);
  background: var(--white); transition: border-color .15s;
  overflow: hidden;
}
.input-prefix:focus-within,
.input-suffix:focus-within {
  border-color: var(--green-700);
  box-shadow: 0 0 0 3px rgba(82,183,136,.15);
}
.input-prefix span,
.input-suffix span {
  padding: .5rem .625rem; font-size: .875rem;
  color: var(--gray-500); font-weight: 500; flex-shrink: 0;
}
.input-prefix input,
.input-suffix input,
.input-select {
  border: none; outline: none; font-size: .9375rem;
  padding: .5rem .5rem .5rem 0; width: 100%;
  font-family: inherit; color: var(--gray-900);
  background: transparent;
}
.input-suffix input { padding-left: .5rem; }
.input-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' stroke='%23737373' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .75rem center;
  padding-right: 2rem;
}
.input-sm {
  border: 2px solid var(--gray-300); border-radius: var(--radius-sm);
  padding: .375rem .625rem; font-size: .875rem;
  font-family: inherit; color: var(--gray-900);
  width: 100%; margin-top: .25rem;
}
.input-sm:focus {
  border-color: var(--green-700);
  box-shadow: 0 0 0 3px rgba(82,183,136,.15); outline: none;
}

.form-actions {
  display: flex; gap: .75rem; flex-wrap: wrap;
  margin-top: .5rem;
}

/* Results panel */
.results-panel {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--gray-200);
  position: sticky; top: 76px;
}
.results-heading {
  font-size: 1rem; font-weight: 700;
  color: var(--gray-500); text-transform: uppercase;
  letter-spacing: .04em; margin-bottom: 1rem;
}
.result-main {
  display: flex; flex-direction: column; align-items: flex-start;
  margin-bottom: 1.25rem;
}
.result-label { font-size: .8125rem; color: var(--gray-500); }
.result-value {
  font-size: 2.5rem; font-weight: 800; line-height: 1.1;
}
.profit-positive { color: var(--green-800); }
.profit-zero { color: var(--gray-500); }
.profit-negative { color: var(--red-600); }

.result-breakdown {
  border-top: 1px solid var(--gray-200);
  padding-top: 1rem; margin-bottom: 1rem;
}
.breakdown-row {
  display: flex; justify-content: space-between;
  font-size: .875rem; padding: .2rem 0;
}
.breakdown-row span:first-child { color: var(--gray-600); }
.breakdown-row span:last-child { font-weight: 600; color: var(--gray-800); }
.breakdown-row.minus span:last-child { color: var(--red-600); }
.breakdown-row.total {
  border-top: 1px solid var(--gray-200);
  margin-top: .5rem; padding-top: .5rem;
}
.breakdown-row.total span { font-weight: 700; color: var(--green-900); }

.result-extras {
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  gap: .5rem; margin-bottom: 1rem;
}
.extra-row {
  background: var(--green-50); border-radius: var(--radius-sm);
  padding: .5rem .625rem; text-align: center;
}
.extra-label { display: block; font-size: .6875rem; color: var(--gray-500); text-transform: uppercase; letter-spacing: .04em; }
.extra-value { display: block; font-size: .9375rem; font-weight: 700; color: var(--green-900); }

.result-verdict {
  display: flex; align-items: center; gap: .5rem;
  padding: .625rem .75rem; border-radius: var(--radius-sm);
  background: var(--green-50); margin-bottom: 1rem;
  font-size: .875rem; color: var(--green-900);
}
.result-verdict.warn { background: var(--amber-100); color: var(--gray-800); }
.result-verdict.bad { background: var(--red-100); color: var(--red-600); }
.verdict-icon { font-size: 1.1em; flex-shrink: 0; }

.result-actions { display: flex; gap: .5rem; }

/* History */
.history-bar {
  margin-top: 2rem;
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
}
.history-heading { font-size: .9375rem; font-weight: 700; color: var(--gray-700); margin-bottom: .75rem; }
.history-list {
  display: flex; flex-wrap: wrap; gap: .5rem;
}
.history-chip {
  display: inline-flex; align-items: center; gap: .375rem;
  padding: .375rem .75rem; border-radius: 999px;
  background: var(--green-100); border: 1px solid var(--green-300);
  font-size: .8125rem; cursor: pointer; color: var(--green-900);
  font-weight: 500; transition: background .15s;
}
.history-chip:hover { background: var(--green-200); }
.history-chip .chip-profit { font-weight: 700; }

/* Reference */
.reference-section { background: var(--white); }
.ref-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}
.ref-card {
  background: var(--green-50); border-radius: var(--radius-md);
  padding: 1.25rem; border: 1px solid var(--gray-200);
}
.ref-card h3 { font-size: 1rem; font-weight: 700; color: var(--green-900); margin-bottom: .5rem; }
.ref-card ul { padding-left: 1.25rem; }
.ref-card li { font-size: .875rem; color: var(--gray-700); margin-bottom: .25rem; }
.ref-card-costs { background: var(--amber-100); }
.ref-card-print { background: var(--gray-100); }
.ref-card-print p { font-size: .875rem; color: var(--gray-600); margin-bottom: .75rem; }

/* Tips */
.tips-section { background: var(--green-50); }
.tips-layout { max-width: 70ch; }
.tips-text p,
.tips-text ol,
.tips-text ul { margin-bottom: 1rem; color: var(--gray-700); }
.tips-text ol,
.tips-text ul { padding-left: 1.25rem; }
.tips-text li { margin-bottom: .25rem; }
.tips-text h3 { font-size: 1.125rem; font-weight: 700; color: var(--green-900); margin: 1.75rem 0 .5rem; }

/* FAQ */
.faq-section { background: var(--white); }
.faq-list { max-width: 70ch; }
.faq-item {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  margin-bottom: .5rem; overflow: hidden;
}
.faq-question {
  width: 100%; text-align: left;
  padding: 1rem 1.25rem;
  font-size: 1rem; font-weight: 600;
  color: var(--gray-900); cursor: pointer;
  background: none; border: none;
  font-family: inherit; list-style: none;
  display: flex; justify-content: space-between; align-items: center;
}
.faq-question::-webkit-details-marker { display: none; }
.faq-question::after {
  content: "+"; font-size: 1.25rem; color: var(--gray-400);
  flex-shrink: 0; margin-left: 1rem;
}
.faq-item[open] .faq-question::after { content: "−"; }
.faq-question:hover { background: var(--green-50); }
.faq-answer { padding: 0 1.25rem 1rem; }
.faq-answer p { font-size: .9375rem; color: var(--gray-700); }

/* Footer */
.site-footer {
  margin-top: auto;
  background: var(--green-900);
  color: var(--green-200);
  padding: 2.5rem 0 1.5rem;
}
.footer-inner {
  display: flex; flex-direction: column; gap: 1.25rem;
}
.footer-brand .logo-text { color: var(--white); font-size: 1rem; }
.footer-tagline { font-size: .8125rem; margin-top: .25rem; }
.footer-tagline a { color: var(--green-300); }
.footer-nav {
  display: flex; flex-wrap: wrap; gap: .75rem;
}
.footer-nav a {
  font-size: .8125rem; color: var(--green-300);
  text-decoration: none;
}
.footer-nav a:hover { color: var(--white); }
.footer-copy { font-size: .75rem; color: var(--green-500); }

/* Responsive */
@media (max-width: 960px) {
  .estimator-layout {
    grid-template-columns: 1fr;
  }
  .results-panel { position: static; }
}

@media (max-width: 700px) {
  .site-nav { display: none; }
  .nav-toggle { display: flex; }
  .site-nav.open {
    display: flex; flex-direction: column;
    position: absolute; top: 60px; left: 0; right: 0;
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    padding: .75rem 1.25rem; gap: .25rem;
    box-shadow: var(--shadow-md);
  }
  .input-grid { grid-template-columns: 1fr; }
  .hero-stats { gap: 1rem; }
  .result-extras { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .container { padding: 0 .875rem; }
  .hero { padding: 2.5rem 0 2rem; }
  .section { padding: 2.5rem 0; }
  .estimator-form-wrap { padding: 1.25rem; }
  .results-panel { padding: 1.25rem; }
  .result-value { font-size: 2rem; }
  .preset-grid { gap: .375rem; }
  .preset-btn { padding: .375rem .625rem; font-size: .8125rem; }
}

/* Print */
@media print {
  .site-header, .site-footer, .hero, .tips-section, .faq-section, .form-actions, .result-actions, .history-bar, .nav-toggle { display: none; }
  body { background: #fff; }
  .section { padding: 0; }
  .estimator-layout { display: block; }
  .results-panel { box-shadow: none; border: 1px solid #ccc; }
  .ref-grid { page-break-inside: avoid; }
}

/* Focus visible */
*:focus-visible {
  outline: 2px solid var(--green-700);
  outline-offset: 2px;
}



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