:root {
  color-scheme: light;
  --ink: #17221d;
  --muted: #66736c;
  --paper: #f5f2e9;
  --surface: #fffdf8;
  --line: #d9d5ca;
  --green: #184d3b;
  --orange: #e2733b;
  --yellow: #f4c95d;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--paper);
  color: var(--ink);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
a { color: var(--green); }
button, input, select, textarea { font: inherit; }

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  min-height: 72px;
  padding: 0 4vw;
  background: rgba(245, 242, 233, .94);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: .85rem; color: var(--ink); text-decoration: none; font-weight: 800; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--green); color: #fff; }
.app-header nav { display: flex; align-items: center; gap: 1rem; }
.app-header nav a { font-size: .86rem; font-weight: 650; text-decoration: none; }
.link-button { padding: 0; border: 0; background: transparent; color: var(--green); cursor: pointer; }

.shell { width: min(1320px, 92vw); margin: 0 auto; padding: 3rem 0 6rem; }
.narrow { width: min(760px, 92vw); }
.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 2rem; margin-bottom: 2rem; }
.eyebrow { margin: 0 0 .45rem; color: var(--orange); font-size: .72rem; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; }
h1, h2, h3 { margin-top: 0; text-wrap: balance; }
h1 { margin-bottom: .5rem; font-family: Georgia, serif; font-size: clamp(2.5rem, 5vw, 5rem); line-height: .95; letter-spacing: -.045em; }
h2 { font-size: 1.35rem; }
.muted { color: var(--muted); }

.button, button.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  min-height: 42px;
  padding: .68rem 1rem;
  border: 1px solid var(--green);
  border-radius: 12px;
  background: transparent;
  color: var(--green);
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
}
.button-primary, button.button-primary { background: var(--green); color: #fff; }
.button-danger, button.button-danger { border-color: #b42318; color: #b42318; }
.button-small { min-height: 34px; padding: .42rem .7rem; font-size: .8rem; }

.banner { margin-bottom: 1.5rem; padding: 1rem 1.1rem; border: 1px solid #e4b54d; border-radius: 14px; background: #fff6d6; }
.banner-error { border-color: #ef9a90; background: #fff0ee; }
.banner-success { border-color: #82bf9c; background: #edf9f1; }

.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 2.5rem; }
.metric { padding: 1.25rem; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.metric strong { display: block; font-family: Georgia, serif; font-size: 2.2rem; }
.metric span { color: var(--muted); font-size: .82rem; }

.panel { margin-bottom: 1.25rem; padding: clamp(1.1rem, 2.5vw, 2rem); border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: 0 8px 30px rgba(23, 34, 29, .04); }
.panel-header { display: flex; align-items: start; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.panel-header h2 { margin-bottom: .25rem; }
.panel-header p { margin: 0; }

.prospect-list { display: grid; gap: .7rem; }
.prospect-row { display: grid; grid-template-columns: minmax(230px, 1.5fr) 1fr auto; align-items: center; gap: 1.5rem; padding: 1rem; border: 1px solid var(--line); border-radius: 14px; color: inherit; text-decoration: none; transition: transform .15s ease, border-color .15s ease; }
.prospect-row:hover { transform: translateY(-2px); border-color: var(--green); }
.prospect-row strong, .prospect-row span { display: block; }
.prospect-row span { color: var(--muted); font-size: .82rem; }

.status { display: inline-flex; align-items: center; gap: .45rem; width: fit-content; padding: .35rem .6rem; border-radius: 999px; background: #e8ece9; color: #34433b; font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status-deployed, .status-exported { background: #dff4e7; color: #17603b; }
.status-do_not_contact, .status-website_found { background: #f3e4e1; color: #943b31; }
.status-review_check, .status-site_review, .status-postcard_review { background: #fff0c2; color: #795300; }

.detail-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr); gap: 1.25rem; align-items: start; }
.facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.fact { padding-bottom: .8rem; border-bottom: 1px solid var(--line); }
.fact dt { margin-bottom: .25rem; color: var(--muted); font-size: .72rem; font-weight: 750; text-transform: uppercase; letter-spacing: .08em; }
.fact dd { margin: 0; }
.actions { display: flex; flex-wrap: wrap; gap: .65rem; }
.actions form { margin: 0; }
.timeline { display: grid; gap: .8rem; padding: 0; list-style: none; }
.timeline li { position: relative; padding-left: 1.3rem; }
.timeline li::before { content: ""; position: absolute; top: .42rem; left: 0; width: 7px; height: 7px; border-radius: 50%; background: var(--orange); }
.timeline time { display: block; color: var(--muted); font-size: .72rem; }

.preview-frame { width: 100%; height: 760px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.locale-tabs, .actions.compact { display: flex; gap: .5rem; flex-wrap: wrap; margin: .75rem 0; }
.version-tabs { display: flex; gap: .5rem; flex-wrap: wrap; margin: 0 0 1rem; }
.translation-review { margin-top: 1.25rem; border-top: 1px solid var(--line); padding-top: 1rem; }
.translation-review details { border: 1px solid var(--line); border-radius: 10px; padding: .75rem; margin: .75rem 0; }
.translation-review summary { cursor: pointer; font-weight: 700; }
.image-prompt { margin-top: 1rem; color: var(--muted); }
.prompt-review { max-height: 420px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; }
.proof-thumb { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: 8px; margin: .75rem 0; }
.evidence-list { display: grid; gap: .8rem; padding: 0; list-style: none; }
.evidence-list li { padding: .8rem; border: 1px solid var(--line); border-radius: 10px; }
.evidence-list a { overflow-wrap: anywhere; font-weight: 700; }

.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.1rem; }
.field { display: grid; gap: .38rem; }
.field-full { grid-column: 1 / -1; }
.field label, fieldset legend { font-size: .78rem; font-weight: 800; }
.field small { color: var(--muted); }
input, select, textarea { width: 100%; padding: .72rem .8rem; border: 1px solid #b9c0bb; border-radius: 10px; background: #fff; color: var(--ink); }
textarea { min-height: 120px; resize: vertical; }
.design-brief { min-height: 340px; line-height: 1.5; }
.optional { color: var(--muted); font-weight: 500; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(24, 77, 59, .18); border-color: var(--green); }
fieldset { margin: 0; padding: 1rem; border: 1px solid var(--line); border-radius: 12px; }
.checks { display: flex; flex-wrap: wrap; gap: .7rem 1rem; }
.check { display: flex; align-items: center; gap: .4rem; }
.check input { width: auto; }
.form-actions { display: flex; gap: .7rem; margin-top: 1.5rem; }
.media-grid, .candidate-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .9rem; margin-top: 1rem; }
.media-card, .media-candidate { display: grid; align-content: start; gap: .65rem; padding: .7rem; border: 1px solid var(--line); border-radius: 12px; background: #fff; overflow: hidden; }
.media-card img, .media-candidate img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 8px; background: #e8ece9; }
.media-card span { display: flex; align-items: center; gap: .45rem; font-size: .8rem; font-weight: 750; }
.media-card input { width: auto; }
.media-card small, .media-candidate small { display: block; color: var(--muted); overflow-wrap: anywhere; }
.layout-picker { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .8rem; margin-top: .6rem; }
.layout-option {
  position: relative;
  display: grid;
  align-content: start;
  gap: .55rem;
  padding: .65rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  cursor: pointer;
}
.layout-option:has(input:checked) { border-color: var(--green); box-shadow: 0 0 0 2px rgba(24, 77, 59, .15); }
.layout-option input { position: absolute; top: .8rem; right: .8rem; width: auto; }
.layout-option > strong { font-size: .9rem; }
.layout-option > small { color: var(--muted); font-size: .72rem; line-height: 1.45; }
.layout-mini { position: relative; display: block; height: 105px; overflow: hidden; border: 1px solid #25302a; background: #f2eee5; }
.layout-mini i, .layout-mini b, .layout-mini em, .layout-mini small { position: absolute; display: block; }
.layout-mini i { top: 0; right: 0; left: 0; height: 17px; border-bottom: 1px solid #25302a; background: #fff; }
.layout-mini b { top: 29px; left: 10px; width: 43%; height: 27px; background: #25302a; }
.layout-mini em { top: 26px; right: 9px; width: 38%; height: 48px; background: #bd704b; }
.layout-mini small { right: 9px; bottom: 9px; left: 9px; height: 16px; border-top: 1px solid #25302a; }
.layout-bold-grid .layout-mini { background-image: linear-gradient(#25302a22 1px, transparent 1px), linear-gradient(90deg, #25302a22 1px, transparent 1px); background-size: 18px 18px; }
.layout-bold-grid .layout-mini b { width: 52%; height: 34px; background: #111; }
.layout-bold-grid .layout-mini em { border: 2px solid #111; background: #f1cf3c; box-shadow: 4px 4px 0 #111; }
.layout-warm-local .layout-mini { border-radius: 12px; background: #fbf2e4; }
.layout-warm-local .layout-mini i { border-radius: 0 0 12px 12px; }
.layout-warm-local .layout-mini b { border-radius: 999px; background: #416c59; }
.layout-warm-local .layout-mini em { border-radius: 50% 50% 10px 10px; background: #d67850; }

.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 2rem; background: var(--green); }
.login-card { width: min(460px, 100%); padding: 2rem; border-radius: 22px; background: var(--surface); box-shadow: 0 24px 80px rgba(0,0,0,.2); }

.public-page { min-height: 100vh; background: #f6f0e5; color: #17221d; }
.public-header, .public-main, .public-footer { width: min(1120px, 90vw); margin: auto; }
.public-header { display: flex; align-items: center; justify-content: space-between; min-height: 82px; border-bottom: 1px solid #d9d2c5; }
.public-hero { padding: 12vw 0; }
.public-hero h1 { max-width: 900px; }
.public-hero p { max-width: 700px; font-size: 1.2rem; line-height: 1.7; }
.public-footer { padding: 2rem 0 4rem; border-top: 1px solid #d9d2c5; }

@media (max-width: 880px) {
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .detail-grid { grid-template-columns: 1fr; }
  .media-grid, .candidate-grid, .layout-picker { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .prospect-row { grid-template-columns: 1fr; gap: .6rem; }
}
@media (max-width: 620px) {
  .app-header { align-items: flex-start; padding-block: 1rem; flex-direction: column; gap: .7rem; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .metric-grid, .form-grid, .facts, .media-grid, .candidate-grid, .layout-picker { grid-template-columns: 1fr; }
}
