/* Landscape Designer — working-tool aesthetic: quiet, drafting-table neutral. */
* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --ink: #2b2b28;
  --muted: #7a776f;
  --line: #d8d5cd;
  --paper: #fbfaf7;
  --panel: #f3f1ec;
  --accent: #33532c;
  --blue: #1a73e8;
  --warn: #b04747;
}
html, body { height: 100%; overflow: hidden; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', sans-serif;
  color: var(--ink);
  background: var(--panel);
  display: flex; flex-direction: column;
  font-size: 13px;
}

/* ---------- header ---------- */
header {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
}
header .brand { font-weight: 700; letter-spacing: 0.3px; margin-right: 6px; white-space: nowrap; }
header .brand span { color: var(--accent); }
#project-name {
  font-size: 14px; font-weight: 600; color: var(--ink);
  border: 1px solid transparent; background: transparent;
  padding: 4px 8px; border-radius: 4px; min-width: 180px; max-width: 320px; flex: 0 1 auto;
}
#project-name:hover, #project-name:focus { border-color: var(--line); background: #fff; outline: none; }
header .spacer { flex: 1; }
.btn {
  font-size: 12px; font-weight: 600; color: var(--ink);
  background: #fff; border: 1px solid var(--line); border-radius: 5px;
  padding: 5px 10px; cursor: pointer; white-space: nowrap;
}
.btn:hover { border-color: #b5b1a6; }
.btn:disabled { opacity: 0.4; cursor: default; }
.btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn.danger { background: #fff; color: var(--warn); border-color: var(--warn); margin-top: 12px; }
.rot-group { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); }
.rot-group input { width: 52px; padding: 4px 5px; border: 1px solid var(--line); border-radius: 5px; font-size: 12px; text-align: right; }
#calib-badge {
  display: none; font-size: 11px; font-weight: 700; color: #fff;
  background: var(--warn); padding: 4px 8px; border-radius: 4px;
}

/* ---------- main ---------- */
#main { display: flex; flex: 1 1 auto; min-height: 0; }

#toolbar {
  flex: 0 0 46px;
  background: var(--paper); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; align-items: center;
  padding: 8px 0; gap: 2px; overflow-y: auto;
}
.tool-btn {
  width: 36px; height: 36px; border: 1px solid transparent; border-radius: 6px;
  background: transparent; cursor: pointer; font-size: 16px; color: var(--ink);
  display: flex; align-items: center; justify-content: center;
}
.tool-btn:hover { background: var(--panel); }
.tool-btn.on { background: #e4ecdf; border-color: var(--accent); color: var(--accent); }

#canvas-wrap { flex: 1 1 auto; position: relative; min-width: 0; }
#canvas-container { position: absolute; inset: 0; background: #dedbd3; }

/* ---------- right panel ---------- */
#side {
  flex: 0 0 300px;
  background: var(--paper); border-left: 1px solid var(--line);
  display: flex; flex-direction: column; min-height: 0;
}
#tool-options { padding: 10px 12px; border-bottom: 1px solid var(--line); }
#tool-options label { display: block; font-size: 11px; font-weight: 700; color: var(--muted); margin: 8px 0 3px; text-transform: uppercase; letter-spacing: 0.4px; }
#tool-options label.chk { display: flex; align-items: center; gap: 6px; text-transform: none; font-size: 12px; font-weight: 600; color: var(--ink); }
#tool-options select, #tool-options input[type=number] {
  width: 100%; padding: 5px 6px; border: 1px solid var(--line); border-radius: 4px; background: #fff; font-size: 12px;
}
#tool-options input[type=range] { width: 100%; }
.hint { font-size: 11.5px; color: var(--muted); line-height: 1.45; margin-top: 6px; }

#palette-wrap { display: none; border-bottom: 1px solid var(--line); overflow: hidden; flex: 0 1 auto; min-height: 0; }
#palette-search {
  margin: 8px 12px 6px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 5px; font-size: 12px;
}
#palette-cats { display: flex; flex-wrap: wrap; gap: 4px; padding: 0 12px 6px; }
.chip {
  font-size: 10.5px; font-weight: 600; padding: 3px 7px; border-radius: 10px;
  border: 1px solid var(--line); background: #fff; cursor: pointer; color: var(--muted);
}
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
#palette { overflow-y: auto; max-height: 300px; padding: 0 8px 8px; }
.plant-card {
  display: flex; gap: 8px; align-items: center; padding: 5px 6px; border-radius: 6px;
  cursor: pointer; border: 1px solid transparent;
}
.plant-card:hover { background: var(--panel); }
.plant-card.on { background: #e4ecdf; border-color: var(--accent); }
.plant-card canvas { flex: 0 0 40px; }
.thumb-holder { flex: 0 0 40px; width: 40px; height: 40px; border-radius: 5px; overflow: hidden; background: var(--panel); }
.thumb-holder img { width: 40px; height: 40px; object-fit: cover; display: block; }
.native-badge {
  font-size: 9px; font-weight: 700; letter-spacing: 0.4px; text-transform: uppercase;
  background: var(--accent); color: #fff; border-radius: 8px; padding: 1px 6px; vertical-align: 1px;
}
.photo-link { text-decoration: none; color: var(--muted); font-size: 11px; }
.photo-link:hover { color: var(--accent); }
#palette-filters { display: flex; gap: 5px; padding: 0 12px 6px; align-items: center; flex-wrap: wrap; }
#palette-filters select { flex: 1 1 120px; min-width: 0; padding: 4px 5px; border: 1px solid var(--line); border-radius: 4px; font-size: 11px; background: #fff; }
#palette-filters input[type=number] { width: 52px; padding: 4px 5px; border: 1px solid var(--line); border-radius: 4px; font-size: 11px; }
.plant-info { min-width: 0; }
.pc { font-weight: 600; font-size: 12.5px; }
.pb { font-style: italic; font-size: 11px; color: var(--muted); }
.pm { font-size: 10.5px; color: var(--muted); }

#side-tabs { display: flex; border-bottom: 1px solid var(--line); flex: 0 0 auto; }
#side-tabs button {
  flex: 1; padding: 8px 4px; font-size: 11px; font-weight: 700; letter-spacing: 0.4px;
  border: none; background: transparent; color: var(--muted); cursor: pointer;
  border-bottom: 2px solid transparent; text-transform: uppercase;
}
#side-tabs button.on { color: var(--accent); border-bottom-color: var(--accent); }
.side-pane { overflow-y: auto; flex: 1 1 auto; min-height: 0; }

.layer-row { display: flex; align-items: center; gap: 6px; padding: 5px 12px; font-size: 12.5px; }
.mini {
  width: 24px; height: 22px; font-size: 11px; border: 1px solid var(--line);
  border-radius: 4px; background: #fff; cursor: pointer;
}
.mini.on { background: #e4ecdf; border-color: var(--accent); }

table.sched { width: 100%; border-collapse: collapse; font-size: 11.5px; }
table.sched th {
  text-align: left; font-size: 10px; letter-spacing: 0.4px; color: var(--muted);
  padding: 6px 6px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--paper);
}
table.sched td { padding: 6px; border-bottom: 1px solid #eceae4; vertical-align: top; }
table.sched td.k { font-weight: 700; color: var(--accent); }

.props { padding: 10px 12px; }
.props label { display: block; font-size: 11px; font-weight: 700; color: var(--muted); margin: 8px 0 3px; text-transform: uppercase; letter-spacing: 0.4px; }
.props label.chk { display: flex; align-items: center; gap: 6px; text-transform: none; font-size: 12px; color: var(--ink); }
.props input, .props select { width: 100%; padding: 5px 6px; border: 1px solid var(--line); border-radius: 4px; font-size: 12px; background: #fff; }
.props .stat { font-size: 12px; color: var(--muted); margin-top: 8px; line-height: 1.5; }

/* ---------- status bar ---------- */
#statusbar {
  flex: 0 0 auto; display: flex; align-items: center; gap: 16px;
  padding: 4px 12px; background: var(--paper); border-top: 1px solid var(--line);
  font-size: 11px; color: var(--muted);
}
#status-coords { font-variant-numeric: tabular-nums; min-width: 150px; }
#scalebar { display: flex; align-items: center; gap: 6px; }
#scalebar-bar { height: 5px; background: var(--ink); border-radius: 1px; transition: width 0.1s; }
#statusbar .spacer { flex: 1; }
#disclaimer { font-size: 10px; }

/* ---------- start screen ---------- */
#start-screen {
  position: absolute; inset: 0; z-index: 20;
  background: rgba(43, 43, 40, 0.45); backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center;
}
.start-card {
  background: var(--paper); border-radius: 10px; padding: 28px 30px;
  width: 460px; max-width: 92vw; box-shadow: 0 12px 40px rgba(0,0,0,0.25);
}
.start-card h1 { font-size: 19px; margin-bottom: 2px; }
.start-card h1 span { color: var(--accent); }
.start-card .sub { color: var(--muted); font-size: 12.5px; margin-bottom: 18px; }
.start-card h2 { font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted); margin: 16px 0 6px; }
.addr-row { display: flex; gap: 6px; }
.addr-row input { flex: 1; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; font-size: 13px; }
#addr-status { margin-top: 8px; font-size: 12px; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
.addr-result {
  text-align: left; padding: 7px 9px; font-size: 12px; background: #fff;
  border: 1px solid var(--line); border-radius: 5px; cursor: pointer;
}
.addr-result:hover { border-color: var(--accent); }
#start-drop {
  border: 2px dashed var(--line); border-radius: 8px; padding: 18px;
  text-align: center; color: var(--muted); cursor: pointer; font-size: 12.5px;
}
#start-drop:hover { border-color: var(--accent); color: var(--accent); }
.start-note { font-size: 10.5px; color: var(--muted); margin-top: 14px; line-height: 1.5; }

/* ---------- dialogs & toast ---------- */
dialog {
  border: none; border-radius: 10px; padding: 20px 22px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.3); width: 340px;
  margin: auto; /* the global reset kills native <dialog> centering */
}
#dlg-welcome { width: 520px; max-width: 94vw; max-height: 86vh; overflow-y: auto; }
#dlg-welcome .wq h4 {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--accent); margin: 12px 0 4px;
}
#dlg-welcome .wq ul { margin: 0 0 4px 18px; }
#dlg-welcome .wq li { font-size: 12.5px; line-height: 1.55; margin-bottom: 2px; }
dialog::backdrop { background: rgba(43,43,40,0.35); }
dialog h3 { font-size: 14px; margin-bottom: 10px; }
dialog p { font-size: 12.5px; color: var(--muted); margin-bottom: 10px; line-height: 1.45; }
dialog input, dialog select { width: 100%; padding: 7px 9px; border: 1px solid var(--line); border-radius: 5px; font-size: 13px; margin-bottom: 10px; }
dialog .row { display: flex; gap: 8px; justify-content: flex-end; }
dialog label { display: block; font-size: 11px; font-weight: 700; color: var(--muted); margin: 6px 0 3px; text-transform: uppercase; }

#toast {
  position: fixed; bottom: 44px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: #fff; font-size: 12.5px;
  padding: 9px 16px; border-radius: 6px; opacity: 0; pointer-events: none;
  transition: all 0.25s; max-width: 520px; z-index: 50; text-align: center;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
