/* DrawMyPlot — site styles */
:root {
  --ink: #17201a; --soft: #4b5a50; --faint: #7c8a80; --line: #dfe5dc; --bg: #fbfcf8; --card: #ffffff;
  --green: #14532d; --green-2: #166534; --lime: #bef264; --lime-ink: #3f6212; --amber: #b45309; --red: #b91c1c; --blue: #1d4ed8;
  --tint: #f1f5ec; --radius: 10px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); line-height: 1.55; font-size: 16px; }
a { color: var(--green-2); }
code { background: var(--tint); padding: 1px 5px; border-radius: 4px; font-size: .9em; }

/* header */
.site-head { display: flex; align-items: center; gap: 24px; padding: 10px 20px; background: #fff; border-bottom: 1px solid var(--line); position: relative; z-index: 1100; }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); font-weight: 700; font-size: 20px; letter-spacing: -.01em; }
.brand b { color: var(--green-2); }
.brand-mark { width: 30px; height: 30px; }
.site-nav { display: flex; gap: 4px; flex-wrap: wrap; }
.site-nav a { text-decoration: none; color: var(--soft); padding: 6px 10px; border-radius: 6px; font-size: 14.5px; font-weight: 500; }
.site-nav a:hover { background: var(--tint); color: var(--ink); }
.site-nav a[aria-current] { color: var(--green); background: var(--tint); }

/* tool intro */
.tool-intro { padding: 14px 20px 10px; max-width: 1400px; }
.tool-intro h1 { margin: 0; font-size: 24px; line-height: 1.25; letter-spacing: -.01em; }
.tool-intro p { margin: 4px 0 0; color: var(--soft); font-size: 15px; max-width: 920px; }

/* app */
.app { display: grid; grid-template-columns: 360px 1fr; height: calc(100vh - 150px); min-height: 560px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #fff; }
.panel { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); background: #fff; }
.tabs { display: flex; border-bottom: 1px solid var(--line); background: var(--tint); }
.tabs button { flex: 1; border: 0; background: transparent; padding: 11px 6px; font: inherit; font-size: 14px; font-weight: 600; color: var(--soft); cursor: pointer; border-bottom: 3px solid transparent; }
.tabs button.on { color: var(--green); border-bottom-color: var(--green-2); background: #fff; }
.tab-body { flex: 1; overflow-y: auto; padding: 14px; font-size: 14.5px; }
.loading { color: var(--faint); }
.mapwrap { position: relative; min-height: 0; }
#map { position: absolute; inset: 0; background: #2b3a2f; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); background: #fff; color: var(--ink); padding: 9px 12px; border-radius: 8px; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; text-decoration: none; line-height: 1.2; }
.btn:hover { border-color: #b9c4b5; background: #fafdf7; }
.btn.primary { background: var(--green-2); border-color: var(--green-2); color: #fff; }
.btn.primary:hover { background: var(--green); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--soft); }
.btn.ghost:hover { background: var(--tint); }
.btn.danger { color: var(--red); }
.btn.sm { padding: 6px 10px; font-size: 13px; }
.btn.wide { width: 100%; margin-top: 8px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn input[type=file] { display: none; }
.ico { font-size: 15px; line-height: 1; }

.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.units { display: grid; grid-template-columns: 1fr; gap: 6px; margin-bottom: 8px; font-size: 13px; color: var(--soft); }
.units label { display: flex; align-items: center; gap: 8px; }
.units select { flex: 1; }
select, input[type=text], input[type=number], input[type=search], textarea {
  font: inherit; font-size: 14px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: var(--ink); width: 100%; min-width: 0;
}
select:focus, input:focus, textarea:focus { outline: 2px solid var(--lime); outline-offset: 0; border-color: var(--green-2); }
textarea { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; resize: vertical; }
.toggle { display: flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--soft); margin: 4px 0 12px; }

.empty { background: var(--tint); border-radius: var(--radius); padding: 12px 14px; color: var(--soft); }
.empty p { margin: 0 0 8px; } .empty p:last-child { margin: 0; }

.plot-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.plot-list li + li { border-top: 1px solid var(--line); }
.plot-list li.sel { background: #fffdf0; }
.plot-row { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: transparent; padding: 10px 12px; font: inherit; font-size: 14px; text-align: left; cursor: pointer; }
.plot-row:hover { background: #fafdf7; }
.shape { width: 14px; height: 14px; flex: none; border: 2px solid var(--lime-ink); background: rgba(190,242,100,.5); }
.shape.poly { clip-path: polygon(50% 0, 100% 38%, 82% 100%, 18% 100%, 0 38%); border: 0; background: var(--lime-ink); }
.shape.pt { border-radius: 50%; }
.pname { flex: 1; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.parea { color: var(--soft); font-variant-numeric: tabular-nums; font-size: 13px; }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.dot.ok { background: #16a34a; } .dot.warn { background: #f59e0b; } .dot.error { background: var(--red); }
.detail { padding: 4px 12px 12px; display: grid; gap: 8px; }
.field { display: grid; gap: 3px; font-size: 12.5px; color: var(--soft); font-weight: 500; }
.stats { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; margin: 4px 0; font-size: 14px; }
.stats dt { color: var(--faint); } .stats dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.stats dd.sub { font-weight: 500; color: var(--soft); margin-top: -2px; }
.coords { margin: 0; font-size: 12.5px; color: var(--soft); font-variant-numeric: tabular-nums; }
table.conv { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.conv caption { text-align: left; font-weight: 600; color: var(--soft); padding: 4px 0; }
table.conv th { text-align: left; font-weight: 400; color: var(--soft); padding: 3px 0; border-top: 1px solid var(--line); }
table.conv td { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; padding: 3px 0; border-top: 1px solid var(--line); }
.total { margin: 10px 2px 6px; color: var(--soft); font-size: 13.5px; }
.total b { color: var(--ink); }
.row-btns { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; align-items: center; }

.check { margin: 8px 0; padding: 8px 10px; border-radius: 8px; font-size: 13.5px; font-weight: 500; }
.check.ok { background: #ecfdf3; color: #166534; }
.check.warn { background: #fffbeb; color: #92400e; }
.check.error { background: #fef2f2; color: var(--red); }
.issues { list-style: none; margin: 4px 0; padding: 0; display: grid; gap: 4px; font-size: 13px; }
.issues li { padding: 6px 8px 6px 26px; border-radius: 6px; position: relative; background: var(--tint); }
.issues li::before { position: absolute; left: 8px; top: 6px; font-weight: 700; }
.issues li.error { background: #fef2f2; color: #7f1d1d; } .issues li.error::before { content: "✕"; color: var(--red); }
.issues li.warn { background: #fffbeb; color: #78350f; } .issues li.warn::before { content: "!"; color: var(--amber); }
.issues li.info { color: var(--soft); } .issues li.info::before { content: "i"; color: var(--blue); }
.issues li.fixed::before { content: "✓"; color: #16a34a; }
.issues li em { color: #166534; font-style: normal; font-weight: 600; }
.issues.report { max-height: 340px; overflow: auto; }

.drop { display: grid; gap: 4px; place-items: center; text-align: center; border: 2px dashed #b9c4b5; border-radius: var(--radius); padding: 28px 14px; cursor: pointer; background: #fafdf7; color: var(--soft); }
.drop b { color: var(--ink); }
.drop.over { border-color: var(--green-2); background: #f0fdf4; }
#mlx-file { position: absolute; width: 1px; height: 1px; opacity: 0; }
.help { color: var(--soft); font-size: 13px; }
.help p { margin: 10px 0; }
.fmts { border: 0; padding: 0; margin: 0 0 8px; display: grid; gap: 6px; }
.fmts legend { font-weight: 600; font-size: 13px; color: var(--soft); margin-bottom: 6px; }
.fmt { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; cursor: pointer; }
.fmt.on { border-color: var(--green-2); background: #f6fdf2; }
.fmt input { margin-top: 3px; }
.fmt span { display: grid; gap: 2px; } .fmt small { color: var(--soft); font-size: 12.5px; line-height: 1.4; }

/* map overlays */
.map-search { position: absolute; top: 10px; left: 56px; right: 64px; max-width: 460px; z-index: 1000; }
.map-search form { display: flex; gap: 6px; background: #fff; border-radius: 9px; padding: 4px; box-shadow: 0 2px 10px rgba(0,0,0,.25); }
.map-search input { border: 0; }
.map-search input:focus { outline: none; }
.results { list-style: none; margin: 4px 0 0; padding: 4px; background: #fff; border-radius: 9px; box-shadow: 0 4px 14px rgba(0,0,0,.25); max-height: 260px; overflow: auto; }
.results button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 7px 8px; font: inherit; font-size: 13.5px; cursor: pointer; border-radius: 6px; }
.results button:hover { background: var(--tint); }
.results .none { padding: 7px 8px; color: var(--faint); font-size: 13.5px; }
.gps-bar, .draw-bar { position: absolute; left: 50%; transform: translateX(-50%); bottom: 34px; z-index: 1000; background: #fff; border-radius: 12px; box-shadow: 0 4px 18px rgba(0,0,0,.3); padding: 10px 12px; display: grid; gap: 8px; width: min(92%, 520px); }
.draw-bar { display: flex; align-items: center; gap: 8px; width: auto; padding: 8px 10px; }
.bar-label { font-weight: 700; font-size: 13.5px; margin-right: 4px; }
.gps-info { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13.5px; align-items: baseline; }
.acc.good { color: #166534; font-weight: 600; } .acc.poor { color: var(--amber); font-weight: 600; }
.gps-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.gps-btns .btn { flex: 1; }
.toast { position: absolute; left: 50%; top: 64px; transform: translate(-50%, -10px); background: #17201a; color: #fff; padding: 9px 14px; border-radius: 9px; font-size: 13.5px; max-width: min(90%, 560px); box-shadow: 0 4px 14px rgba(0,0,0,.3); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 1001; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: var(--red); } .toast.ok { background: var(--green); }
.locate-btn { width: 34px; height: 34px; line-height: 32px; text-align: center; font-size: 20px; background: #fff; color: var(--ink); text-decoration: none; display: block; }
.pin { background: #bef264; border: 3px solid #fff; border-radius: 50%; box-shadow: 0 0 0 2px #3f6212; }
.pin.sel { background: #facc15; box-shadow: 0 0 0 2px #92400e; }
.plot-tip { font-weight: 600; }

/* content */
.page-intro { max-width: 860px; margin: 0 auto; padding: 44px 20px 10px; }
.page-intro h1 { font-size: 34px; line-height: 1.2; margin: 0 0 10px; letter-spacing: -.02em; }
.page-intro .lead { font-size: 18px; color: var(--soft); margin: 0; }
.content { max-width: 860px; margin: 0 auto; padding: 18px 20px 40px; }
.content section { margin: 30px 0; }
.content h2 { font-size: 24px; line-height: 1.3; margin: 0 0 10px; letter-spacing: -.01em; }
.content h3 { font-size: 18px; margin: 20px 0 6px; }
.content p, .content li { color: #26332a; }
.content ol.steps { counter-reset: s; list-style: none; padding: 0; display: grid; gap: 10px; }
.content ol.steps li { counter-increment: s; padding: 12px 14px 12px 50px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); position: relative; }
.content ol.steps li::before { content: counter(s); position: absolute; left: 14px; top: 12px; width: 24px; height: 24px; border-radius: 50%; background: var(--green-2); color: #fff; font-weight: 700; font-size: 13px; display: grid; place-items: center; }
.content .cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.content .card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.content .card h3 { margin: 0 0 4px; font-size: 16px; }
.content .card p { margin: 0; font-size: 14.5px; color: var(--soft); }
.content .card a { text-decoration: none; }
.content table { width: 100%; border-collapse: collapse; font-size: 14.5px; background: #fff; }
.content th, .content td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.content th { background: var(--tint); font-weight: 600; }
.table-wrap { overflow-x: auto; }
.note { background: #fffbeb; border-left: 4px solid #f59e0b; padding: 10px 14px; border-radius: 0 8px 8px 0; color: #78350f; font-size: 15px; }
.faq details { border-bottom: 1px solid var(--line); padding: 12px 0; }
.faq summary { font-weight: 600; cursor: pointer; }
.faq details > div { padding-top: 6px; color: #26332a; }
.updated { color: var(--faint); font-size: 13px; }
.ad { margin: 26px 0; min-height: 90px; }
.noscript { padding: 20px; text-align: center; }

/* footer */
.site-foot { background: #10261a; color: #c8d5cb; padding: 34px 20px 24px; font-size: 14px; }
.foot-cols { max-width: 1100px; margin: 0 auto; display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 24px; }
.foot-cols a { display: block; color: #e3ebe4; text-decoration: none; padding: 2px 0; }
.foot-cols a:hover { color: var(--lime); }
.foot-brand { font-weight: 700; font-size: 18px; color: #fff; margin: 0 0 6px; }
.foot-brand b { color: var(--lime); }
.foot-h { color: #fff; font-weight: 600; margin: 0 0 6px; }
.disclaimer, .copy { max-width: 1100px; margin: 20px auto 0; font-size: 12.5px; color: #93a597; }
.copy { margin-top: 6px; }
.copy a { color: #c8d5cb; }

/* mobile */
@media (max-width: 860px) {
  .site-head { flex-wrap: wrap; gap: 6px 14px; padding: 8px 14px; }
  .site-nav { width: 100%; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 2px; }
  .site-nav a { white-space: nowrap; font-size: 14px; padding: 5px 8px; }
  .tool-intro { padding: 10px 14px 8px; }
  .tool-intro h1 { font-size: 20px; }
  .tool-intro p { font-size: 14px; }
  .app { display: flex; flex-direction: column; height: auto; min-height: 0; }
  .mapwrap { order: 1; height: 62vh; min-height: 380px; }
  .panel { order: 2; border-right: 0; border-top: 1px solid var(--line); }
  .tab-body { overflow: visible; }
  .map-search { left: 50px; right: 52px; }
  .foot-cols { grid-template-columns: 1fr 1fr; }
  .foot-cols > div:first-child { grid-column: 1 / -1; }
  .page-intro { padding-top: 28px; }
  .page-intro h1 { font-size: 27px; }
}

/* print: map plus plot table */
#print-sheet { display: none; }
@media print {
  body.printing > *:not(.app):not(#print-sheet) { display: none !important; }
  body.printing .app { display: block; height: auto; border: 0; }
  body.printing .panel, body.printing .map-search, body.printing .gps-bar, body.printing .draw-bar, body.printing .toast, body.printing .leaflet-control-container .leaflet-top { display: none !important; }
  body.printing .mapwrap { height: 16cm; position: relative; }
  body.printing #print-sheet { display: block; font-size: 11pt; }
  #print-sheet table { width: 100%; border-collapse: collapse; }
  #print-sheet th, #print-sheet td { border: 1px solid #999; padding: 4px 6px; text-align: left; }
}

/* ---------- accounts & billing ---------- */
.site-account { margin-left: auto; display: flex; align-items: center; }
.acct-link { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); font-weight: 600; font-size: 14px; padding: 4px 8px; border-radius: 20px; border: 1px solid var(--line); }
.acct-link img { border-radius: 50%; }
.auth-card { max-width: 460px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 24px; display: grid; gap: 12px; justify-items: start; }
.auth-points { margin: 4px 0; padding-left: 20px; color: var(--soft); font-size: 15px; }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; margin: 10px 0 8px !important; }
.plan { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 20px; display: flex; flex-direction: column; gap: 8px; position: relative; }
.plan.pro { border-color: var(--green-2); }
.plan.best { box-shadow: 0 6px 22px rgba(22,101,52,.15); }
.plan h2 { font-size: 18px !important; margin: 0 !important; }
.plan .price { font-size: 32px; font-weight: 800; margin: 0; letter-spacing: -.02em; }
.plan .price small { font-size: 15px; font-weight: 500; color: var(--soft); }
.plan ul { margin: 0 0 8px; padding-left: 18px; flex: 1; font-size: 14.5px; }
.plan .tag { position: absolute; top: -11px; right: 14px; background: var(--lime); color: var(--lime-ink); font-weight: 700; font-size: 12px; padding: 3px 9px; border-radius: 12px; }
.btn.disabled { opacity: .5; cursor: default; }
.center { text-align: center; }
.acct-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; margin: 14px 0 !important; }
.acct-card.block { display: block; }
.acct-card h2 { font-size: 19px !important; margin: 0 0 4px !important; }
.acct-user { display: flex; align-items: center; gap: 12px; }
.acct-user img { border-radius: 50%; }
.acct-user span { color: var(--soft); font-size: 14px; }
.tag-test { background: #fef3c7; color: #92400e; padding: 1px 6px; border-radius: 4px; font-size: 12px; font-weight: 600; }
form.inline { display: inline; }
td.right { text-align: right; white-space: nowrap; }
.cloud { border: 1px dashed #b9c4b5; border-radius: var(--radius); padding: 10px 12px; margin: 0 0 12px; background: #fcfdfb; }
.cloud-h { margin: 0 0 4px; font-size: 14px; }
.cloud .help { margin: 4px 0 6px; }
.pro-tag { background: var(--green-2); color: #fff; font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 4px; vertical-align: 1px; }
.modal { position: fixed; inset: 0; background: rgba(15, 23, 18, .55); z-index: 3000; display: grid; place-items: center; padding: 16px; }
.modal-box { background: #fff; border-radius: 14px; padding: 20px 22px; max-width: 440px; width: 100%; box-shadow: 0 20px 50px rgba(0,0,0,.35); }
.modal-box h3 { margin: 0 0 8px; font-size: 18px; }
.modal-text { color: #26332a; font-size: 15px; }
.modal-text p { margin: 0 0 10px; }
.proj-list { list-style: none; margin: 0; padding: 0; max-height: 320px; overflow: auto; display: grid; gap: 6px; }
.proj-list button { width: 100%; text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 9px 11px; font: inherit; cursor: pointer; display: grid; }
.proj-list button:hover { border-color: var(--green-2); background: #f6fdf2; }
.proj-list span { color: var(--soft); font-size: 13px; }
@media (max-width: 860px) { .site-account { position: absolute; top: 8px; right: 12px; } }
