/* PegPicker Mapping – same design system as PegPicker Manage (copied from manage/assets/app.css),
   plus the lake map editor. Fonts: Baloo 2 from Google Fonts (same face Manage self-hosts). */
:root{
  --brand:#1051ab; --brand-d:#0c418a; --brand-50:#e6ecf5; --brand-25:#f2f6fb;
  --white:#efefed; --ink:#1d2433; --ink-2:#3b4458; --muted:#6b7487; --line:#e3e8f0; --bg:#f3f5f9; --card:#fff; --input:#f4f6fa;
  --green:#15803d; --green-50:#e5f5ea; --amber:#b45309; --amber-50:#fdf1de; --red:#c62828; --red-50:#fdeaea; --grey-50:#eef0f4;
  --glass:rgba(0,0,0,.3);
  --r:12px; --r-sm:8px; --shadow:0 1px 2px rgba(16,24,40,.05),0 4px 14px rgba(16,24,40,.06); --shadow-lg:0 25px 60px rgba(0,0,0,.15);
  --side:256px;
}
*{box-sizing:border-box;margin:0;padding:0}
html{-webkit-text-size-adjust:100%}
body{font-family:'Baloo 2',system-ui,sans-serif;background:var(--bg);color:var(--ink);font-size:15px;line-height:1.45;-webkit-font-smoothing:antialiased}
a{color:var(--brand);text-decoration:none}
img{max-width:100%;display:block}
.ic{flex:none}
h1,h2,h3{line-height:1.2;font-weight:600}
h2{font-size:18px} h3{font-size:16px}
small,.muted{color:var(--muted)}
.hidden{display:none!important}

/* ---------- Shell ---------- */
.shell{display:flex;min-height:100vh}
.sidebar{width:var(--side);background:var(--brand);color:var(--white);position:fixed;inset:0 auto 0 0;display:flex;flex-direction:column;padding:14px 12px;z-index:40;overflow-y:auto}
.brand{display:flex;align-items:center;gap:10px;color:#fff;padding:4px 6px 14px;font-weight:600;font-size:18px}
.brand img{height:38px;width:38px;border-radius:8px}
.brand span{opacity:.85}
.fishery-switch{display:flex;align-items:center;gap:10px;background:rgba(255,255,255,.1);border-radius:var(--r);padding:9px 10px;color:#fff;margin-bottom:14px;transition:.15s}
.fishery-switch:hover{background:rgba(255,255,255,.16)}
.fs-avatar{width:34px;height:34px;border-radius:9px;background:#fff;color:var(--brand);display:grid;place-items:center;font-weight:700;flex:none}
.fs-text{display:flex;flex-direction:column;min-width:0;flex:1;line-height:1.2}
.fs-text strong{font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.fs-text small{color:rgba(255,255,255,.7);font-size:12px}
.nav{display:flex;flex-direction:column;gap:2px}
.nav a{display:flex;align-items:center;gap:12px;padding:10px 12px;border-radius:10px;color:rgba(255,255,255,.82);font-weight:500;transition:.15s}
.nav a:hover{background:rgba(255,255,255,.08);color:#fff}
.nav a.active{background:#fff;color:var(--brand);font-weight:600}
.side-cta{margin-top:16px}
.side-link{display:flex;align-items:center;gap:8px;color:rgba(255,255,255,.75);font-size:14px;padding:10px 12px}
.side-link:hover{color:#fff}
.side-user{margin-top:auto;display:flex;align-items:center;gap:10px;padding:10px 6px 2px;border-top:1px solid rgba(255,255,255,.15)}
.avatar{width:34px;height:34px;border-radius:50%;background:rgba(255,255,255,.18);display:grid;place-items:center;font-weight:600;flex:none}
.su-text{display:flex;flex-direction:column;min-width:0;flex:1;line-height:1.2}
.su-text strong{font-weight:600;font-size:14px}
.su-text small{color:rgba(255,255,255,.65);font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.side-user .icon-btn{color:#fff}
.sidebar-scrim{display:none}

.main{flex:1;margin-left:var(--side);min-width:0;display:flex;flex-direction:column;min-height:100vh;min-height:100dvh}
.topbar{position:sticky;top:0;z-index:30;background:rgba(243,245,249,.86);backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);display:flex;align-items:center;gap:12px;padding:14px 28px;min-height:68px}
.topbar-title{display:flex;align-items:center;gap:6px;min-width:0;flex:1}
.topbar h1{font-size:24px;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.topbar .back{display:grid;place-items:center;width:34px;height:34px;border-radius:50%;color:var(--ink);background:#fff;box-shadow:var(--shadow)}
.topbar-actions{display:flex;gap:8px;align-items:center}
.topbar .menu-btn{display:none}
.content{padding:6px 28px 40px;width:100%;flex:1 0 auto}
.mfoot{display:flex;justify-content:space-between;gap:12px;flex-wrap:wrap;padding:16px 28px;border-top:1px solid var(--line);color:var(--muted);font-size:13.5px;background:#fff}
.mfoot a{color:var(--muted)}
.mfoot a:hover{color:var(--brand)}
/* ---------- Buttons ---------- */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:7px;border:none;border-radius:var(--r-sm);padding:9px 16px;font:inherit;font-weight:600;font-size:15px;cursor:pointer;transition:.15s;white-space:nowrap;background:#fff;color:var(--ink);box-shadow:inset 0 0 0 1px var(--line);line-height:1.3}
.btn:hover{background:var(--brand-25)}
.btn-primary{background:var(--brand);color:#fff;box-shadow:none}
.btn-primary:hover{background:var(--brand-d);transform:translateY(-1px);box-shadow:0 6px 18px rgba(16,81,171,.3)}
.btn-light{background:#fff;color:var(--brand);box-shadow:none}
.btn-light:hover{background:var(--brand-50)}
.btn-soft{background:var(--brand-50);color:var(--brand);box-shadow:none}
.btn-soft:hover{background:#d8e2f1}
.btn-green{background:var(--green);color:#fff;box-shadow:none}
.btn-green:hover{filter:brightness(1.08)}
.btn-danger{background:#fff;color:var(--red);box-shadow:inset 0 0 0 1px #f3c4c4}
.btn-danger:hover{background:var(--red-50)}
.btn-ghost{background:transparent;box-shadow:none;color:var(--ink-2)}
.btn-ghost:hover{background:rgba(16,81,171,.06)}
.btn-sm{padding:6px 12px;font-size:14px}
.btn-xs{padding:3px 9px;font-size:13px;border-radius:6px}
.btn-block{width:100%}
.btn[disabled]{opacity:.5;pointer-events:none}
.icon-btn{display:inline-grid;place-items:center;width:36px;height:36px;border-radius:50%;border:none;background:transparent;color:var(--ink-2);cursor:pointer}
.icon-btn:hover{background:rgba(0,0,0,.06)}

/* ---------- Cards ---------- */
.card{background:var(--card);border-radius:var(--r);box-shadow:var(--shadow);overflow:hidden}
.empty{padding:34px 20px;text-align:center;color:var(--muted)}
.empty .ic{color:#b7c3d7;margin:0 auto 8px}
.empty strong{display:block;color:var(--ink);font-weight:600;margin-bottom:2px}

/* ---------- Table ---------- */
.table-wrap{overflow-x:auto}
table.table{width:100%;border-collapse:collapse;font-size:14.5px}
.table th{font-weight:600;font-size:12.5px;text-transform:uppercase;letter-spacing:.04em;color:var(--muted);text-align:left;padding:12px 16px;border-bottom:1px solid var(--line);white-space:nowrap;background:#fafbfd}
.table td{padding:12px 16px;border-bottom:1px solid var(--line);vertical-align:middle}
.table tr:last-child td{border-bottom:none}
.table tr.click{cursor:pointer}
.table tr.click:hover td{background:var(--brand-25)}
.table .num{text-align:right;white-space:nowrap}
.form{display:flex;flex-direction:column;gap:16px}
.fgrid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px 16px}
.fgrid .full{grid-column:1/-1}
.fgrid-3{grid-template-columns:repeat(3,minmax(0,1fr))}
.field{display:flex;flex-direction:column;gap:6px;min-width:0}
.field>label,.label{font-size:14px;font-weight:600;color:#333}
.field .hint{font-size:12.5px;color:var(--muted);font-weight:400}
.input,select.input,textarea.input{width:100%;padding:10px 13px;border-radius:10px;border:1px solid transparent;background:var(--input);font:inherit;font-size:15px;color:var(--ink);transition:.15s;min-height:42px}
textarea.input{min-height:110px;resize:vertical;line-height:1.5}
.input:focus{outline:none;background:#fff;border-color:var(--brand);box-shadow:0 0 0 3px rgba(16,81,171,.12)}
select.input{appearance:none;-webkit-appearance:none;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7487' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 12px center;padding-right:36px}
.input-group{display:flex;align-items:center;background:var(--input);border-radius:10px;border:1px solid transparent}
.input-group:focus-within{background:#fff;border-color:var(--brand);box-shadow:0 0 0 3px rgba(16,81,171,.12)}
.input-group>span{padding:0 0 0 12px;color:var(--muted);font-weight:600}
.input-group .input{background:transparent;border:none;box-shadow:none}
.alert{display:flex;align-items:flex-start;gap:10px;padding:12px 14px;border-radius:10px;margin-bottom:14px;font-weight:500}
.alert .ic{margin-top:1px}
.alert-ok{background:var(--green-50);color:var(--green)}
.alert-error{background:var(--red-50);color:var(--red)}
.alert-info{background:var(--brand-50);color:var(--brand)}
.alert-warn{background:var(--amber-50);color:var(--amber)}
.toast-wrap{position:fixed;bottom:22px;left:50%;transform:translateX(-50%);z-index:100;display:flex;flex-direction:column;gap:8px;align-items:center;pointer-events:none}
.toast{background:var(--ink);color:#fff;padding:10px 16px;border-radius:10px;box-shadow:var(--shadow-lg);font-weight:500;animation:up .25s ease}
.toast.err{background:var(--red)}
@keyframes up{from{opacity:0;transform:translateY(10px)}}
.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
body.mauth-body{background:#fff}
.mauth{min-height:100vh;min-height:100dvh;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.1fr)}
.mauth-side{display:flex;flex-direction:column;padding:28px clamp(22px,5vw,72px);min-width:0}
.mauth-top{display:flex;align-items:center;gap:10px}
.mauth-logo img{height:34px;width:auto;display:block}
.mauth-tag{font-size:12.5px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--brand);background:var(--brand-50);padding:4px 10px;border-radius:999px}
.mauth-card{flex:1;display:flex;flex-direction:column;justify-content:center;width:100%;max-width:420px;margin:0 auto;padding:36px 0;animation:up .45s cubic-bezier(.2,.8,.2,1)}
.mauth-card .form{gap:18px}
.mauth-card h1{font-size:clamp(30px,3vw,38px);font-weight:800;letter-spacing:-.02em;line-height:1.05;margin-bottom:8px}
.mauth-card p.lead{color:var(--muted);font-size:16px;margin:0 0 6px}
.mauth-card .field{gap:7px}
.mauth-card .field label{font-weight:600;font-size:14.5px}
.mauth-card .label-row{display:flex;justify-content:space-between;align-items:baseline}
.mauth-card .label-row a{font-size:14px;font-weight:600}
.mauth-card .input{min-height:54px;border-radius:14px;border:1.5px solid #e1e7f0;background:#f7f9fc;font-size:16px;padding:12px 16px;transition:border-color .15s,box-shadow .15s,background .15s}
.mauth-card .input:focus{border-color:var(--brand);background:#fff;box-shadow:0 0 0 4px rgba(16,81,171,.12);outline:none}
.mauth-card .input::placeholder{color:#a0a8b8}
.pw-wrap{position:relative}
.pw-wrap .input{width:100%;padding-right:52px;box-sizing:border-box}
.pw-eye{position:absolute;right:8px;top:50%;transform:translateY(-50%);width:38px;height:38px;border-radius:50%;border:none;background:transparent;color:#8a93a6;cursor:pointer;display:grid;place-items:center}
.pw-eye:hover{background:var(--brand-25);color:var(--brand)}
.mauth-card .btn{width:100%;min-height:54px;border-radius:14px;font-size:16.5px;font-weight:700;margin-top:4px;display:inline-flex;align-items:center;justify-content:center;gap:8px;position:relative}
.mauth-card .btn-primary{box-shadow:0 10px 24px rgba(16,81,171,.25);transition:transform .15s,box-shadow .15s}
.mauth-card .btn-primary:hover{transform:translateY(-1px);box-shadow:0 14px 30px rgba(16,81,171,.32)}
.mauth-card .btn.busy{color:transparent}
.mauth-card .btn.busy::after{content:'';position:absolute;width:20px;height:20px;border-radius:50%;border:2.5px solid rgba(255,255,255,.4);border-top-color:#fff;animation:spin .7s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}
.btn-ghost-lg{background:#fff;color:var(--ink);border:1.5px solid #e1e7f0}
.btn-ghost-lg:hover{border-color:var(--brand);color:var(--brand)}
.auth-or{display:flex;align-items:center;gap:12px;color:var(--muted);font-size:13.5px;margin:4px 0 -4px}
.auth-or::before,.auth-or::after{content:'';flex:1;height:1px;background:var(--line)}
.mauth-card .auth-links{text-align:left;margin-top:4px;font-size:14.5px}
.mauth-card .alert{margin-bottom:6px}
.auth-ic{width:56px;height:56px;border-radius:16px;background:var(--brand-50);color:var(--brand);display:grid;place-items:center;margin-bottom:16px}
.otp{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:10px}
.otp input{width:100%;box-sizing:border-box;height:62px;text-align:center;font:inherit;font-size:26px;font-weight:700;border-radius:14px;border:1.5px solid #e1e7f0;background:#f7f9fc;color:var(--ink)}
.otp input:focus{outline:none;border-color:var(--brand);background:#fff;box-shadow:0 0 0 4px rgba(16,81,171,.12)}
.mauth-foot{display:flex;flex-direction:column;gap:12px;align-items:flex-start;font-size:13.5px;color:var(--muted);max-width:420px;width:100%;margin:0 auto}
.mauth-angler{display:flex;align-items:center;gap:10px;width:100%;box-sizing:border-box;padding:12px 14px;border-radius:14px;background:var(--brand-25);border:1px solid var(--line);color:var(--ink-2);font-size:14.5px;transition:border-color .15s}
.mauth-angler:hover{border-color:var(--brand)}
.mauth-angler svg{color:var(--brand);flex:none}
.mauth-angler strong{color:var(--brand)}
/* Right: photo with a glimpse of the product */
.mauth-art{position:relative;overflow:hidden;color:#fff;display:flex;align-items:flex-end;isolation:isolate;margin:12px;border-radius:28px;background:#0b2c5c}
.mauth-bg{position:absolute;inset:0;z-index:-2;background-position:center;background-size:cover;transform:scale(1.06);animation:heroZoom 22s ease-out forwards}
.mauth-art::after{content:'';position:absolute;inset:0;z-index:-1;background:linear-gradient(180deg,rgba(5,20,45,.15) 0%,rgba(5,20,45,.35) 40%,rgba(5,20,45,.9) 100%)}
@keyframes heroZoom{to{transform:scale(1)}}
.mauth-art-in{padding:clamp(28px,4vw,56px);width:100%;box-sizing:border-box;max-width:640px}
.mauth-kick{display:inline-block;font-size:13px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:#0b356f;background:#ffcc4d;padding:4px 12px;border-radius:999px}
.mauth-art h2{font-size:clamp(34px,3.6vw,54px);line-height:1;font-weight:800;letter-spacing:-.02em;margin:14px 0 22px}
.mauth-mock{background:rgba(255,255,255,.14);border:1px solid rgba(255,255,255,.24);backdrop-filter:blur(14px) saturate(1.2);-webkit-backdrop-filter:blur(14px) saturate(1.2);border-radius:20px;padding:14px;display:flex;flex-direction:column;gap:8px;max-width:460px;box-shadow:0 20px 50px rgba(0,0,0,.25)}
.mm-head{display:flex;justify-content:space-between;align-items:baseline;padding:2px 4px 4px;font-size:14px}
.mm-head strong{font-size:17px}
.mm-head span{opacity:.8}
.mm-row{display:flex;align-items:center;gap:12px;background:#fff;color:var(--ink);border-radius:14px;padding:10px 12px;animation:mmIn .5s cubic-bezier(.2,.8,.2,1) both}
.mm-row:nth-child(2){animation-delay:.25s}.mm-row:nth-child(3){animation-delay:.4s}.mm-row:nth-child(4){animation-delay:.55s}
@keyframes mmIn{from{opacity:0;transform:translateY(12px)}to{opacity:1;transform:none}}
.mm-peg{width:40px;height:40px;border-radius:11px;background:var(--brand);color:#fff;display:grid;place-items:center;font-weight:800;flex:none}
.mm-b{flex:1;min-width:0}
.mm-b b{display:block;font-size:14.5px;font-weight:700;line-height:1.2}
.mm-b small{color:var(--muted);font-size:12.5px}
.mm-chip{font-size:12px;font-weight:700;padding:4px 10px;border-radius:999px;background:#fdf1de;color:#b45309;white-space:nowrap}
.mm-chip.ok{background:#e5f5ea;color:#15803d}
.mauth-points{list-style:none;margin:22px 0 0;padding:0;display:flex;flex-direction:column;gap:10px;font-weight:600;font-size:16px}
.mauth-points li{display:flex;align-items:center;gap:10px}
.mauth-points li::before{content:'';width:20px;height:20px;border-radius:50%;flex:none;background:#ffcc4d url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230b356f' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4L18 8.5'/%3E%3C/svg%3E") center/14px no-repeat}
@media (prefers-reduced-motion:reduce){.mauth-bg,.mm-row,.mauth-card{animation:none}}
@media (max-width:960px){
  .mauth{grid-template-columns:1fr;grid-template-rows:auto 1fr}
  .mauth-art{order:-1;margin:0;border-radius:0 0 28px 28px;min-height:200px;align-items:flex-end}
  .mauth-art h2{font-size:30px;margin:10px 0 0}
  .mauth-mock,.mauth-points{display:none}
  .mauth-art-in{padding:84px 22px 26px}
  .mauth-side{padding:0 22px 22px}
  .mauth-top{position:absolute;top:18px;left:22px;z-index:3}
  .mauth-logo img{filter:brightness(0) invert(1)}
  .mauth-tag{background:rgba(255,255,255,.18);color:#fff}
  .mauth-card{padding:26px 0;justify-content:flex-start}
}

.hidden{display:none!important}
.empty p{margin-top:4px}
.empty .ic{display:block}

/* ---------- Responsive shell (as Manage) ---------- */
@media (max-width:860px){
  .sidebar{transform:translateX(-100%);transition:transform .25s ease;box-shadow:var(--shadow-lg)}
  body.side-open .sidebar{transform:none}
  body.side-open .sidebar-scrim{display:block;position:fixed;inset:0;background:rgba(16,24,40,.4);z-index:35}
  .main{margin-left:0}
  .topbar .menu-btn{display:inline-grid}
  .topbar{padding:10px 14px;min-height:58px;background:var(--brand);color:#fff}
  .topbar .icon-btn{color:#fff}
  .topbar h1{font-size:20px}
  .topbar-actions .btn:not(.keep){display:none}
  .content{padding:14px 14px 24px}
  .mfoot{padding:14px;justify-content:center;text-align:center}
  .table .hide-sm{display:none}
}

/* ================= Lake map editor ================= */
/* The editor's own button names, drawn as Manage buttons */
.btn.primary{background:var(--brand);color:#fff;box-shadow:none}
.btn.primary:hover{background:var(--brand-d)}
.btn.yellow{background:#ffcc4d;color:#0b356f;box-shadow:none;font-weight:700}
.btn.yellow:hover{background:#ffd56b;transform:translateY(-1px);box-shadow:0 6px 18px rgba(0,0,0,.18)}
.btn.danger{color:var(--red);box-shadow:inset 0 0 0 1px #f3c4c4}
.btn.danger:hover{background:var(--red-50)}
.btn.ghost-light{background:rgba(255,255,255,.12);color:#fff;box-shadow:inset 0 0 0 1px rgba(255,255,255,.28)}
.btn.ghost-light:hover{background:rgba(255,255,255,.2)}
.btn.block{display:flex;width:100%;margin-top:8px}
.btn.small{padding:5px 11px;font-size:14px}
.btn:disabled{opacity:.45;cursor:default;pointer-events:none}
.btn:focus-visible,.tool:focus-visible,.editor input:focus-visible,.editor select:focus-visible{outline:3px solid rgba(16,81,171,.35);outline-offset:2px}

body.editor{display:flex;flex-direction:column;height:100vh;height:100dvh;overflow:hidden}
.editor input:not([type=range]):not([type=checkbox]),.editor select{font:inherit;font-size:14.5px;border:1px solid transparent;border-radius:10px;padding:6px 11px;min-height:38px;background:var(--input);color:var(--ink);transition:.15s}
.editor input:not([type=range]):not([type=checkbox]):focus,.editor select:focus{outline:none;background:#fff;border-color:var(--brand);box-shadow:0 0 0 3px rgba(16,81,171,.12)}
.editor input[type=range]{width:100%;accent-color:var(--brand)}
.editor input[type=checkbox]{width:18px;height:18px;accent-color:var(--brand)}
.editor label{display:flex;flex-direction:column;gap:4px;font-weight:600;font-size:14px;color:var(--ink-2)}
.editor label.switch{flex-direction:row;align-items:center;gap:8px}
.editor .row{display:flex;gap:8px;align-items:center;margin-top:8px;flex-wrap:wrap}
.editor .row label{flex-direction:row;align-items:center;gap:8px}
.editor .small{font-size:13.5px}
.editor .right:not(.panel){text-align:right}
.hint{font-size:13.5px;line-height:1.4;color:var(--muted);margin:6px 0 0}
.error{background:var(--red-50);color:var(--red);padding:8px 12px;border-radius:10px}

/* Header: Manage brand blue */
.ed-top{flex:none;height:62px;background:var(--brand);color:#fff;display:flex;align-items:center;gap:10px;padding:0 14px}
.ed-back{display:grid;place-items:center;width:34px;height:34px;border-radius:50%;background:rgba(255,255,255,.14);color:#fff;flex:none}
.ed-back:hover{background:rgba(255,255,255,.24)}
.ed-brand img{height:36px;width:36px;border-radius:8px;flex:none}
.ed-top .name-input{min-width:260px;flex:0 1 340px;background:rgba(255,255,255,.12)!important;color:#fff!important;font-weight:600}
.ed-top .name-input::placeholder{color:rgba(255,255,255,.65)}
.ed-top .name-input:focus{background:rgba(255,255,255,.2)!important;border-color:rgba(255,255,255,.5)!important;box-shadow:none!important}
.ed-top select{background:rgba(255,255,255,.12)!important;color:#fff!important;max-width:240px}
.ed-top select option{color:var(--ink)}
.ed-status{color:rgba(255,255,255,.85);font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:34vw}
.spacer{flex:1}

.workspace{flex:1;display:grid;grid-template-columns:276px 1fr 296px;min-height:0}
.panel{background:#fff;overflow-y:auto;padding:16px;border-right:1px solid var(--line)}
.panel.right{border-right:0;border-left:1px solid var(--line)}
.panel section{padding-bottom:16px;margin-bottom:16px;border-bottom:1px solid var(--line)}
.panel section:last-child{border-bottom:0;margin-bottom:0}
.panel h2{font-size:16px;font-weight:700;margin-bottom:8px;display:flex;align-items:center;gap:8px}
.step{width:24px;height:24px;border-radius:7px;background:var(--brand-50);color:var(--brand);display:inline-grid;place-items:center;font-size:13px;font-weight:700;flex:none}
.file{position:relative}
.tools{display:grid;grid-template-columns:1fr 1fr;gap:6px}
.tool{font:inherit;font-size:14px;font-weight:600;border:none;box-shadow:inset 0 0 0 1px var(--line);background:#fff;color:var(--ink);border-radius:var(--r-sm);min-height:38px;cursor:pointer;padding:3px 6px;transition:.15s}
.tool:hover{background:var(--brand-25)}
.tool.active{background:var(--brand);color:#fff;box-shadow:none}

.stage-wrap{position:relative;background:var(--bg);min-width:0;background-image:radial-gradient(#d9e0ea 1px,transparent 1px);background-size:18px 18px}
#stage{width:100%;height:100%;display:block;touch-action:none;user-select:none;cursor:grab}
#stage[data-tool=peg],#stage[data-tool=lake],#stage[data-tool=carpark],#stage[data-tool=track],#stage[data-tool=railway],#stage[data-tool=toilet],#stage[data-tool=entrance],#stage[data-tool=label],#stage[data-tool=nopeg],#stage[data-tool=pickwater],#stage[data-tool=island],#stage[data-tool=road],#stage[data-tool=lodge]{cursor:crosshair}
#stage [data-k=peg],#stage [data-k=marker],#stage [data-k=nozone],#stage [data-k=carpark],#stage [data-k=vtx]{cursor:move}
.zoom{position:absolute;right:14px;bottom:14px;display:flex;gap:6px}
.zoom .btn{box-shadow:var(--shadow),inset 0 0 0 1px var(--line);min-width:40px}
.empty-stage{position:absolute;inset:0;display:grid;place-items:center;pointer-events:none;text-align:center}
.empty-stage>div{background:#fff;border-radius:var(--r);box-shadow:var(--shadow);padding:26px 30px;display:flex;flex-direction:column;align-items:center;gap:4px;color:var(--muted)}
.empty-stage .ic{color:#b7c3d7;margin-bottom:4px}
.empty-stage strong{color:var(--ink);font-size:17px;font-weight:600}
.empty-stage[hidden]{display:none}

.lake-card{box-shadow:inset 0 0 0 1px var(--line);border-radius:var(--r);padding:6px 10px 10px;margin-bottom:10px;transition:.15s}
.lake-card.active{box-shadow:inset 0 0 0 2px var(--brand);background:var(--brand-25)}
.lake-card .lk-name{width:100%;font-weight:700}
.lake-card .lk-count{width:72px}

dialog{margin:auto;border:0;border-radius:16px;padding:0;width:min(1200px,94vw);max-height:90vh;box-shadow:var(--shadow-lg)}
dialog::backdrop{background:rgba(16,24,40,.45)}
.dlg-head{display:flex;justify-content:space-between;align-items:center;padding:14px 20px;border-bottom:1px solid var(--line);position:sticky;top:0;background:#fff}
.dlg-head h2{font-size:18px}
.preview-list{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:18px;padding:20px;overflow:auto;max-height:calc(90vh - 70px);background:var(--bg)}
.preview-list figure{margin:0;background:#fff;border-radius:var(--r);box-shadow:var(--shadow);padding:10px}
.preview-list img{width:100%;border-radius:8px;display:block}
.preview-list figcaption{display:flex;gap:8px;align-items:center;margin-top:10px}
.preview-list figcaption strong{flex:1;font-weight:600}

/* Tablets: both panels share the left column, map on the right */
@media (max-width:1100px){
  .workspace{grid-template-columns:270px 1fr;grid-template-rows:minmax(0,1fr) minmax(0,1fr)}
  .panel.left{grid-column:1;grid-row:1;border-bottom:1px solid var(--line)}
  .panel.right{grid-column:1;grid-row:2;border-left:0;border-right:1px solid var(--line)}
  .stage-wrap{grid-column:2;grid-row:1 / span 2}
}
/* Phones: header on two rows, map pinned on top, every panel scrolls underneath */
@media (max-width:760px){
  .ed-top{height:auto;flex-wrap:wrap;padding:8px 10px;gap:8px}
  .ed-brand,.ed-status,.ed-top .spacer{display:none}
  .ed-back{order:0}
  .ed-top .name-input{order:1;min-width:0;flex:1 1 calc(100% - 52px)}
  .ed-top .ed-chip{order:2;flex:1 1 0;min-width:0;max-width:none}
  .ed-top .btn{order:3;flex:none;padding:7px 11px;font-size:14px}
  .workspace{display:flex;flex-direction:column;overflow-y:auto}
  .stage-wrap{order:-1;flex:none;height:52vh;height:52dvh;position:sticky;top:0;z-index:3;border-bottom:1px solid var(--line)}
  .panel,.panel.right{overflow:visible;border:0;flex:none}
  .panel.right{border-top:1px solid var(--line)}
  .zoom{right:10px;bottom:10px}
  .g-frame span{top:-30px}
}

/* ---------- Status pills ---------- */
.pill-live,.pill-draft{display:inline-block;font-size:12px;font-weight:700;padding:2px 9px;border-radius:999px;line-height:1.5;vertical-align:middle}
.pill-live{background:var(--green-50);color:var(--green)}
.pill-draft{background:var(--grey-50);color:var(--muted)}

/* ---------- New map: choose fishery and lake ---------- */
.fish-list{display:flex;flex-direction:column;margin-top:12px;max-height:60vh;overflow:auto;border-top:1px solid var(--line)}
.fish-row{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:12px 6px;border-bottom:1px solid var(--line);color:var(--ink)}
.fish-row:hover{background:var(--brand-25)}
.fish-row strong{font-weight:600}
.fish-row small{color:var(--muted);white-space:nowrap}
.pick-h{margin:22px 0 2px}
.pick-h:first-child{margin-top:0}
.pick-p{margin-bottom:10px}
.pick-card{display:flex;align-items:center;justify-content:space-between;gap:14px;background:#fff;border-radius:var(--r);box-shadow:var(--shadow);padding:14px 16px;margin-bottom:10px;flex-wrap:wrap}
.pick-main{display:flex;align-items:center;gap:12px;min-width:0}
.pick-main strong{display:block;font-weight:600}
.pick-main small{color:var(--muted)}
.pick-ic{width:40px;height:40px;border-radius:11px;background:var(--brand-50);color:var(--brand);display:grid;place-items:center;flex:none}
.pick-acts{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.card-pad{padding:18px 20px}

/* ---------- Editor: linking ---------- */
.ed-chip{display:inline-flex;align-items:center;gap:6px;background:rgba(255,255,255,.14);border-radius:999px;padding:5px 12px;font-weight:600;font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:320px}
.lake-card select{width:100%}
.lk-linked{font-weight:600;border-radius:8px;padding:3px 9px}
.lk-linked.ok{background:var(--green-50);color:var(--green)}
.lk-linked.warn{background:var(--amber-50);color:var(--amber)}
#selPanel select{width:100%}

/* ---------- Editor: approve and publish ---------- */
.pub-dlg{width:min(860px,94vw)}
.pub-body{padding:14px 20px;max-height:calc(90vh - 140px);overflow:auto}
.pub-list{display:flex;flex-direction:column;gap:10px;margin-top:10px}
.pub-row{display:grid;grid-template-columns:auto 150px 1fr;gap:14px;align-items:center;padding:10px;border-radius:var(--r);box-shadow:inset 0 0 0 1px var(--line)}
.pub-row.off{opacity:.65}
.pub-check input{width:20px;height:20px;accent-color:var(--brand)}
.pub-prev{width:150px;height:110px;border-radius:10px;overflow:hidden;background:#e4eedb;display:grid;place-items:center;color:var(--muted);font-size:13px}
.pub-prev svg{width:100%;height:100%;display:block}
.pub-info{display:flex;flex-direction:column;gap:2px;min-width:0}
.pub-info strong{font-size:16px;font-weight:700}
.pub-info small{color:var(--muted);font-size:13.5px}
.pub-info small.warn{color:var(--amber)}
.pub-live{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-top:4px}
.pub-foot{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:12px 20px;border-top:1px solid var(--line);background:#fff;position:sticky;bottom:0}
@media (max-width:640px){.pub-row{grid-template-columns:auto 1fr}.pub-prev{display:none}}

/* ---------- Editor: find on Google ---------- */
.ed-more{margin-top:8px}
.ed-more summary{cursor:pointer;font-size:14px;font-weight:600;color:var(--brand);padding:4px 0}
.g-dlg{width:min(1180px,96vw);height:min(860px,92vh);max-height:92vh}
.g-dlg[open]{display:flex;flex-direction:column}
.g-dlg .dlg-head{gap:12px}
.g-search{position:relative;flex:1;max-width:520px}
.g-search input{width:100%;font:inherit;font-size:15px;border:1px solid transparent;border-radius:10px;padding:8px 13px;min-height:40px;background:var(--input);color:var(--ink)}
.g-search input:focus{outline:none;background:#fff;border-color:var(--brand);box-shadow:0 0 0 3px rgba(16,81,171,.12)}
.g-sug{position:absolute;left:0;right:0;top:calc(100% + 4px);z-index:5;background:#fff;border-radius:12px;box-shadow:var(--shadow-lg);overflow:hidden;border:1px solid var(--line)}
.g-sug button{display:block;width:100%;text-align:left;border:0;background:none;padding:9px 13px;font:inherit;font-size:15px;color:var(--ink);cursor:pointer;line-height:1.3}
.g-sug button small{display:block;color:var(--muted);font-size:13px}
.g-sug button:hover{background:var(--brand-25)}
.g-pow{padding:5px 13px 7px;text-align:right;font-size:11px;color:var(--muted);border-top:1px solid var(--line)}
.g-stage{position:relative;flex:1;min-height:0;background:#e5e3df}
.g-map{position:absolute;inset:0}
.g-frame{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);border:3px solid #ffcc4d;border-radius:4px;box-shadow:0 0 0 9999px rgba(10,18,32,.35);pointer-events:none}
.g-frame span{position:absolute;left:50%;top:-34px;transform:translateX(-50%);background:#ffcc4d;color:#0b356f;font-weight:700;font-size:13px;padding:4px 12px;border-radius:999px;white-space:nowrap}
.g-types{position:absolute;left:12px;top:12px;display:flex;background:#fff;border-radius:10px;box-shadow:var(--shadow);overflow:hidden}
.g-types button{border:0;background:#fff;font:inherit;font-weight:600;font-size:14px;padding:7px 14px;cursor:pointer;color:var(--ink-2)}
.g-types button.on{background:var(--brand);color:#fff}
.g-opts{display:flex;gap:16px;align-items:center;flex-wrap:wrap}
.g-opts label{flex-direction:row;align-items:center;gap:8px}
.g-dlg .pub-foot{flex-wrap:wrap}
#stage[data-tool=tree],#stage[data-tool=erase]{cursor:crosshair}
.sc-opts{gap:12px}
@media (max-width:760px){.g-dlg .dlg-head h2{display:none}}

/* ---------- Editor: link a map to a fishery ---------- */
button.ed-chip{border:0;font:inherit;font-weight:600;font-size:14px;color:#fff;cursor:pointer}
.ed-chip.warn{background:#ffcc4d;color:#0b356f}
.ed-chip.warn:hover{background:#ffd56b}
.f-dlg{width:min(560px,94vw)}
.f-body{padding:14px 20px 18px}
.f-q{width:100%;margin-top:10px;font:inherit;font-size:15px;border:1px solid transparent;border-radius:10px;padding:9px 13px;min-height:42px;background:var(--input);color:var(--ink)}
.f-q:focus{outline:none;background:#fff;border-color:var(--brand);box-shadow:0 0 0 3px rgba(16,81,171,.12)}
.f-dlg .fish-row{width:100%;border:0;border-bottom:1px solid var(--line);background:none;font:inherit;text-align:left;cursor:pointer}
.f-dlg .fish-row:disabled{opacity:.5}
@media (max-width:760px){.ed-top .ed-chip{max-width:44vw}}

/* ---------- Editor: name the lakes ---------- */
.name-bar{position:absolute;left:12px;right:12px;bottom:12px;z-index:4;background:#fff;border-radius:16px;box-shadow:var(--shadow-lg);padding:12px 14px;max-width:620px;margin:0 auto}
.name-bar[hidden]{display:none}
.nb-head{display:flex;align-items:baseline;gap:10px;margin-bottom:10px}
.nb-head strong{font-size:17px;font-weight:700}
.nb-head small{color:var(--muted);flex:1}
.nb-x{border:0;background:var(--grey-50);width:30px;height:30px;border-radius:50%;font-size:20px;line-height:1;cursor:pointer;color:var(--ink-2)}
.nb-opts{display:flex;flex-wrap:wrap;gap:8px}
.nb-opts .btn{padding:8px 14px}
button.ed-chip:not(.warn):hover{background:rgba(255,255,255,.24)}
.chip-caret{opacity:.75;font-size:11px}
.row-acts{white-space:nowrap}
.row-acts .btn + .btn{margin-left:6px}
.del-pt{position:absolute;left:14px;bottom:14px;z-index:3;box-shadow:var(--shadow),inset 0 0 0 1px #f3c4c4}
.del-pt[hidden]{display:none}
