/* Folsom City Carpentry: free ADU tools. All classes start with at- so they won't collide with style.css. */
:root {
  --at-espresso: #1d1f23; --at-bark: #34383e; --at-gold: #b8863b; --at-gold-deep: #96682a; --at-gold-light: #d8ac57;
  --at-cream: #f4f5f7; --at-sand: #eef0f2; --at-ink: #16181b; --at-body: #3e434a; --at-muted: #697079;
  --at-bg: #f7f8f9; --at-surface: #fff; --at-border: #e3e6e9; --at-border-str: #cdd2d8;
  --at-shadow: 0 1px 2px rgba(16,18,22,.06), 0 4px 10px rgba(16,18,22,.05), 0 18px 40px -12px rgba(16,18,22,.22);
  --at-vignette: radial-gradient(120% 90% at 30% 0%, #3b3f46 0%, #25282d 45%, #141619 100%);
  --at-good: #3f7a4a; --at-good-bg: #e7f1e6; --at-warn: #9a5b12; --at-warn-bg: #fbf0dc; --at-bad: #a3402e; --at-bad-bg: #f8e4df;
  --at-display: "Fraunces", Georgia, serif;
  --at-sans: "Inter", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
* { box-sizing: border-box; }
.at-page [hidden] { display: none !important; }
body.at-page :where(main) { margin: 0; background: var(--at-bg); color: var(--at-body); font: 17px/1.65 var(--at-sans); overflow-x: hidden; }
.at-page :where(main) a { color: var(--at-gold-deep); }
.at-page :where(main) h1, .at-page :where(main) h2, .at-page :where(main) h3 { font-family: var(--at-display); color: var(--at-ink); line-height: 1.2; font-weight: 600; letter-spacing: -0.01em; }
.at-wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.at-narrow { max-width: 760px; }

/* Header / footer stand-ins (the live site's template replaces these) */
.at-header { background: var(--at-espresso); }
.at-header .at-wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; flex-wrap: wrap; }
.at-brand { font-family: var(--at-display); color: var(--at-cream) !important; font-size: 1.25rem; text-decoration: none; font-weight: 600; }
.at-header nav a { color: #b4bac2; text-decoration: none; font-size: .95rem; margin-left: 18px; }
.at-header nav a:hover { color: var(--at-cream); }
.at-footer { background: #141619; color: #b4bac2; font-size: .9rem; padding: 28px 0; }
.at-footer a { color: #b4bac2; }

/* Hero */
.at-hero { background: var(--at-vignette); box-shadow: inset 0 0 120px rgba(0,0,0,.45), inset 0 -40px 60px -30px rgba(0,0,0,.35); color: var(--at-cream); padding: 40px 0 56px; }
.at-crumbs { font-size: .85rem; color: #b4bac2; margin: 0 0 28px; }
.at-crumbs a { color: #b4bac2; text-decoration: none; }
.at-crumbs a:hover { color: var(--at-cream); }
.at-eyebrow { color: var(--at-gold); text-transform: uppercase; letter-spacing: .12em; font-size: .8rem; font-weight: 700; margin: 0 0 12px; }
.at-hero h1 { color: var(--at-cream); font-size: clamp(2rem, 5vw, 3.1rem); margin: 0 0 16px; max-width: 20ch; }
.at-hero .at-lead { font-size: 1.12rem; max-width: 62ch; color: #d6dae0; margin: 0; }

/* Sections */
.at-section { padding: 56px 0; }
.at-section.at-alt { background: var(--at-sand); }
.at-section h2 { font-size: clamp(1.5rem, 3.2vw, 2.1rem); margin: 0 0 16px; }
.at-section h3 { font-size: 1.2rem; margin: 28px 0 8px; }
.at-section ul { padding-left: 1.2em; }
.at-section li { margin-bottom: 8px; }

/* Calculator layout */
.at-calc { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; margin-top: -32px; position: relative; }
.at-card { background: var(--at-surface); border: 1px solid var(--at-border); border-radius: 14px; padding: 26px; box-shadow: var(--at-shadow); min-width: 0; }
.at-card h2 { font-size: 1.35rem; margin: 0 0 4px; }
.at-card .at-sub { color: var(--at-muted); font-size: .92rem; margin: 0 0 18px; }
.at-group { border: 0; padding: 0; margin: 0 0 18px; }
.at-group legend { font-weight: 700; color: var(--at-ink); font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 10px; padding: 0; }
.at-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.at-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.at-field.at-full { grid-column: 1 / -1; }
.at-field label { font-size: .9rem; font-weight: 600; color: var(--at-ink); line-height: 1.3; }
.at-field .at-hint { font-size: .8rem; color: var(--at-muted); line-height: 1.35; }
.at-input { display: flex; align-items: stretch; border: 1px solid var(--at-border-str); border-radius: 8px; background: #fff; overflow: hidden; transition: border-color .15s, box-shadow .15s; }
.at-input:focus-within { border-color: var(--at-gold); box-shadow: 0 0 0 3px rgba(184,134,59,.2); }
.at-input span { display: grid; place-items: center; padding: 0 10px; background: var(--at-cream); color: var(--at-muted); font-size: .9rem; font-weight: 600; }
.at-input input, .at-input select { flex: 1; min-width: 0; border: 0; padding: 10px 12px; font: inherit; font-size: 1rem; color: var(--at-ink); background: transparent; outline: none; }
.at-input input:disabled { color: var(--at-muted); background: #f1f3f5; }
select.at-select, .at-input select { appearance: auto; }
.at-check { display: flex; gap: 10px; align-items: flex-start; font-size: .92rem; color: var(--at-ink); cursor: pointer; }
.at-check input { margin-top: 4px; accent-color: var(--at-gold-deep); width: 18px; height: 18px; flex-shrink: 0; }
.at-seg { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--at-border-str); border-radius: 8px; overflow: hidden; }
.at-seg label { margin: 0; display: block; cursor: pointer; }
.at-seg input { position: absolute; opacity: 0; pointer-events: none; }
.at-seg span { display: block; text-align: center; padding: 9px 8px; font-size: .88rem; font-weight: 600; color: var(--at-body); line-height: 1.3; }
.at-seg input:checked + span { background: var(--at-espresso); color: var(--at-cream); }
.at-seg input:focus-visible + span { outline: 2px solid var(--at-gold); outline-offset: -2px; }

/* Results */
.at-results { align-self: start; }
.at-headline { background: var(--at-vignette); box-shadow: inset 0 0 60px rgba(0,0,0,.4), 0 6px 18px -8px rgba(0,0,0,.35); color: var(--at-cream); border-radius: 12px; padding: 20px 22px; margin-bottom: 18px; }
.at-headline p { margin: 0; font-size: 1.05rem; color: #d6dae0; }
.at-headline strong { color: var(--at-gold-light); font-family: var(--at-display); font-size: 1.6rem; font-weight: 600; display: block; line-height: 1.2; margin-bottom: 4px; }
.at-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.at-metric { border: 1px solid var(--at-border); border-radius: 10px; padding: 12px 14px; background: linear-gradient(180deg, #fff, var(--at-bg)); box-shadow: 0 1px 2px rgba(16,18,22,.05); min-width: 0; }
.at-metric .at-k { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--at-muted); font-weight: 600; line-height: 1.3; }
.at-metric .at-v { font-family: var(--at-display); font-size: 1.45rem; color: var(--at-ink); font-weight: 600; line-height: 1.25; margin-top: 2px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.at-metric .at-n { font-size: .8rem; color: var(--at-muted); line-height: 1.35; }
.at-pill { display: inline-block; font-family: var(--at-sans); font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: 2px 8px; border-radius: 999px; vertical-align: middle; margin-left: 6px; }
.at-pill.good { background: var(--at-good-bg); color: var(--at-good); }
.at-pill.warn { background: var(--at-warn-bg); color: var(--at-warn); }
.at-pill.bad { background: var(--at-bad-bg); color: var(--at-bad); }
.at-table { width: 100%; border-collapse: collapse; font-size: .95rem; font-variant-numeric: tabular-nums; }
.at-table td { padding: 8px 0; border-top: 1px solid var(--at-border); }
.at-table td:last-child { text-align: right; font-weight: 600; color: var(--at-ink); }
.at-disclaimer { font-size: .8rem; color: var(--at-muted); margin: 14px 0 0; line-height: 1.45; }

/* Bar comparison */
.at-bars { margin: 0 0 18px; }
.at-bar { margin-bottom: 12px; }
.at-bar .at-bar-label { display: flex; justify-content: space-between; gap: 10px; font-size: .9rem; font-weight: 600; color: var(--at-ink); margin-bottom: 4px; }
.at-bar .at-bar-track { height: 14px; background: var(--at-sand); border-radius: 999px; overflow: hidden; }
.at-bar .at-bar-fill { height: 100%; border-radius: 999px; background: var(--at-gold); transition: width .35s ease; }
.at-bar.dark .at-bar-fill { background: var(--at-bark); }

/* Buttons + CTA */
.at-btn { display: inline-block; background: var(--at-gold); color: var(--at-espresso) !important; font-weight: 700; padding: 13px 24px; border-radius: 8px; text-decoration: none; border: 0; font: 700 1rem var(--at-sans); cursor: pointer; }
.at-btn:hover { background: var(--at-gold-light); }
.at-btn.at-outline { background: transparent; border: 1px solid var(--at-border-str); color: var(--at-ink) !important; }
.at-cta { background: var(--at-vignette); box-shadow: inset 0 0 140px rgba(0,0,0,.5); color: var(--at-cream); }
.at-cta h2 { color: var(--at-cream) !important; }
.at-cta p { color: #d6dae0; }
.at-cta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 36px; align-items: start; }
.at-form { background: var(--at-surface); border-radius: 14px; padding: 24px; color: var(--at-body); box-shadow: 0 20px 50px -16px rgba(0,0,0,.6); }
.at-form .at-fields { margin-bottom: 14px; }
.at-form textarea { width: 100%; border: 1px solid var(--at-border-str); border-radius: 8px; padding: 10px 12px; font: inherit; min-height: 84px; }
.at-hidden { position: absolute; left: -9999px; }

/* FAQ + related */
.at-page details { background: var(--at-surface); border: 1px solid var(--at-border); border-radius: 10px; padding: 16px 20px; margin-bottom: 12px; }
.at-page summary { font-weight: 600; color: var(--at-ink); cursor: pointer; }
.at-page details p { margin: 10px 0 0; }
.at-related { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-top: 20px; }
.at-related a { display: block; background: var(--at-surface); border: 1px solid var(--at-border); border-radius: 12px; padding: 18px; text-decoration: none; color: var(--at-body); transition: border-color .15s, transform .15s; }
.at-related a:hover { border-color: var(--at-gold); transform: translateY(-2px); box-shadow: var(--at-shadow); }
.at-related strong { display: block; font-family: var(--at-display); font-size: 1.1rem; color: var(--at-ink); margin-bottom: 4px; }
.at-related span { font-size: .9rem; }
.at-example { background: var(--at-surface); border-left: 4px solid var(--at-gold); border-radius: 0 10px 10px 0; padding: 18px 22px; }

/* Lot check */
.at-plan-svg { width: 100%; height: auto; display: block; background: #fafbfc; border: 1px solid var(--at-border); border-radius: 10px; }
.at-legend { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: .82rem; color: var(--at-muted); margin: 10px 0 16px; padding: 0; list-style: none; }
.at-legend li { display: flex; align-items: center; gap: 6px; margin: 0; }
.at-legend i { width: 14px; height: 14px; border-radius: 3px; display: inline-block; border: 1px solid rgba(0,0,0,.15); }
.at-planlist { list-style: none; padding: 0; margin: 0 0 8px; display: grid; gap: 8px; }
.at-planlist li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--at-border); border-radius: 8px; font-size: .92rem; margin: 0; }
.at-planlist li.fits { background: var(--at-good-bg); border-color: #c5dcc3; }
.at-planlist li.nofit { color: var(--at-muted); }
.at-planlist li.chosen { outline: 2px solid var(--at-gold); }
.at-planlist button { font: 600 .8rem var(--at-sans); border: 1px solid var(--at-border-str); background: #fff; border-radius: 6px; padding: 4px 10px; cursor: pointer; color: var(--at-ink); }
.at-flags { list-style: none; padding: 0; margin: 0; }
.at-flags li { padding: 10px 0 10px 28px; border-top: 1px solid var(--at-border); position: relative; font-size: .92rem; margin: 0; }
.at-flags li::before { content: "!"; position: absolute; left: 0; top: 11px; width: 18px; height: 18px; border-radius: 50%; background: var(--at-warn-bg); color: var(--at-warn); font-weight: 800; font-size: .75rem; display: grid; place-items: center; }
.at-flags li.ok::before { content: "\2713"; background: var(--at-good-bg); color: var(--at-good); }

/* Article */
.at-article { font-size: 1.08rem; }
.at-article h2 { margin-top: 44px; }
.at-article p, .at-article li { max-width: 68ch; }
.at-byline { color: #b4bac2; font-size: .92rem; margin-top: 18px; }
.at-callout { background: var(--at-sand); border-radius: 12px; padding: 20px 24px; margin: 28px 0; }
.at-callout p:last-child { margin-bottom: 0; }

/* Tools hub */
.at-tools { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; margin-top: -32px; position: relative; }
.at-tool { background: var(--at-surface); border: 1px solid var(--at-border); border-radius: 14px; padding: 24px; text-decoration: none; color: var(--at-body) !important; box-shadow: var(--at-shadow); display: flex; flex-direction: column; gap: 8px; transition: transform .15s, border-color .15s; }
.at-icon svg { width: 22px; height: 22px; }
.at-tool:hover { transform: translateY(-3px); border-color: var(--at-gold); }
.at-tool h2 { font-size: 1.3rem; margin: 0; }
.at-tool p { margin: 0; font-size: .95rem; flex: 1; }
.at-tool .at-go { color: var(--at-gold-deep); font-weight: 700; font-size: .95rem; }
.at-icon { width: 44px; height: 44px; border-radius: 10px; background: var(--at-vignette); box-shadow: inset 0 0 14px rgba(0,0,0,.5); color: var(--at-gold); display: grid; place-items: center; }

/* Aerial view (lot check) */
.at-map-card h2 { margin-top: 0; }
.at-map-tabs { max-width: 420px; margin: 0 0 16px; }
.at-map-search { display: flex; gap: 10px; max-width: 620px; }
.at-map-search .at-input { flex: 1; }
.at-map-search .at-btn { padding: 11px 22px; }
.at-map-msg { font-size: .88rem; color: var(--at-muted); margin: 8px 0 0; }
.at-map-upload { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.at-map-upload .at-map-msg { margin: 0; }
.at-visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.at-map-upload input:focus-visible + .at-map-msg, .at-map-upload label:focus-within { outline: 2px solid var(--at-gold); }
.at-map-scale { margin-top: 14px; padding: 14px 16px; background: var(--at-bg); border: 1px solid var(--at-border); border-radius: 10px; font-size: .92rem; }
.at-map-scale p { margin: 0 0 10px; }
.at-map-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.at-short { width: 120px; }
.at-btn.at-sm { padding: 9px 16px; font-size: .9rem; }
.at-btn.at-on { background: var(--at-espresso); color: var(--at-cream) !important; border-color: var(--at-espresso); }
.at-map-wrap { position: relative; margin-top: 16px; border-radius: 12px; overflow: hidden; background: var(--at-vignette); box-shadow: inset 0 0 0 1px rgba(0,0,0,.08), 0 10px 30px -12px rgba(0,0,0,.35); }
.at-map { height: 480px; width: 100%; background: transparent; }
.at-map-wrap::after { content: ""; position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 90px rgba(0,0,0,.35); border-radius: 12px; z-index: 450; }
.at-map-empty { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 24px; color: #d6dae0; z-index: 460; }
.at-map-empty p { margin: 0; max-width: 32ch; }
.at-map-empty[hidden] { display: none; }
.at-map-picking { cursor: crosshair !important; }
.at-map-tools { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto; gap: 16px; align-items: end; margin-top: 16px; }
.at-map-btns { justify-content: flex-end; }
.at-range { width: 100%; accent-color: var(--at-gold-deep); height: 40px; }
.at-map-readout { margin: 14px 0 0; font-weight: 600; color: var(--at-ink); min-height: 1.5em; }
.at-map-handle { display: grid !important; place-items: center; border-radius: 50%; background: #fff; color: var(--at-ink); font-size: 15px; line-height: 1; box-shadow: 0 2px 8px rgba(0,0,0,.45); border: 2px solid var(--at-gold-deep); }
.at-map-handle.corner { background: #fff; border: 2px solid #16181b; }
.at-map-label { background: rgba(22,24,27,.82); color: #fff; border: 0; box-shadow: none; font: 700 12px var(--at-sans); padding: 2px 6px; border-radius: 4px; }
.at-map-label::before { display: none; }
.at-map-adu { cursor: move; }

@media (max-width: 900px) {
  .at-map-tools { grid-template-columns: 1fr 1fr; }
  .at-map-btns { grid-column: 1 / -1; justify-content: flex-start; }
  .at-calc, .at-cta-grid { grid-template-columns: 1fr; }
  .at-results { position: static; }
}
@media (max-width: 520px) {
  .at-fields { grid-template-columns: 1fr; }
  .at-card { padding: 20px 16px; }
  .at-wrap { padding: 0 16px; }
  .at-header nav a { margin: 0 14px 0 0; }
  .at-metric .at-v { font-size: 1.25rem; }
  .at-map { height: 380px; }
  .at-map-tools { grid-template-columns: 1fr; }
  .at-map-search .at-btn { padding: 11px 16px; }
}
