/* link.css - "Design a link" panel, route sheet (PDF) and the suggest-a-cable form. Colours follow the site theme. */
#lk-panel, #lk-modal {
  --lk-bg: var(--pv-surface, #111d2d); --lk-bg2: var(--pv-surface-2, #162638); --lk-bd: var(--pv-border, #1e3148);
  --lk-bd2: var(--pv-border-hi, #2a4261); --lk-tx: var(--pv-text, #d8e4f4); --lk-mu: var(--pv-text-muted, #7a92aa);
  --lk-ac: var(--pv-accent, #2dd4bf); --lk-z: #f472b6;
}
#lk-panel {
  position: fixed; z-index: 40; left: 16px; top: 132px; bottom: 16px; width: 392px; max-width: calc(100vw - 32px);
  display: flex; flex-direction: column; background: color-mix(in srgb, var(--lk-bg) 94%, transparent);
  border: 1px solid var(--lk-bd); border-radius: 12px; box-shadow: 0 18px 48px rgba(0, 0, 0, .45);
  color: var(--lk-tx); font: 13px/1.45 var(--pv-sans, ui-sans-serif, system-ui, sans-serif);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); overflow: hidden; white-space: normal; text-align: left;
}
#lk-panel[hidden], #lk-hint[hidden], #lk-modal[hidden], #lk-panel .lk-sug[hidden], #lk-modal .lk-sug[hidden] { display: none !important; }
#lk-panel button, #lk-modal button { font: inherit; color: inherit; cursor: pointer; }
#lk-panel button:disabled { opacity: .45; cursor: default; }
.lk-head { position: relative; padding: 14px 44px 10px 16px; border-bottom: 1px solid var(--lk-bd); }
.lk-grab { display: none; }
.lk-title { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; letter-spacing: .01em; }
.lk-title svg { color: var(--lk-ac); }
.lk-subt { color: var(--lk-mu); font-size: 12px; margin-top: 2px; }
.lk-head { cursor: pointer; padding-right: 84px !important; }
.lk-min { position: absolute; right: 44px; top: 8px; width: 32px; height: 32px; border-radius: 8px; background: none; border: 0;
  display: grid; place-items: center; color: var(--lk-mu) !important; }
.lk-min:hover { background: var(--lk-bg2); color: var(--lk-tx) !important; }
.lk-min svg { transition: transform .15s; }
.lk-sum { display: none; font-size: 12px; color: var(--lk-mu); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lk-sum b { color: var(--lk-tx); font-weight: 600; }
#lk-panel.is-peek { bottom: auto; }
#lk-panel.is-peek .lk-body, #lk-panel.is-peek .lk-foot, #lk-panel.is-peek .lk-subt { display: none; }
#lk-panel.is-peek .lk-sum { display: block; }
#lk-panel.is-peek .lk-head { border-bottom: 0; }
#lk-panel.is-peek .lk-min svg { transform: rotate(180deg); }
.lk-x { position: absolute; right: 8px; top: 8px; width: 32px; height: 32px; border-radius: 8px; background: none; border: 0;
  font-size: 22px !important; line-height: 1; color: var(--lk-mu) !important; }
.lk-x:hover { background: var(--lk-bg2); color: var(--lk-tx) !important; }
.lk-body { flex: 1; min-height: 0; overflow-y: auto; padding: 12px 14px 4px; overscroll-behavior: contain; }

.lk-pts { position: relative; display: grid; gap: 8px; }
.lk-pt { display: grid; grid-template-columns: 28px 1fr 38px; align-items: center; gap: 8px; }
.lk-tag { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; font: 800 12px/1 'JetBrains Mono', ui-monospace, monospace; color: #06090e; }
.lk-tag--A { background: var(--lk-ac); } .lk-tag--Z { background: var(--lk-z); }
.lk-in { position: relative; min-width: 0; }
.lk-in input, .lk-ref, .lk-form input, .lk-form textarea {
  width: 100%; box-sizing: border-box; background: var(--pv-bg, #0a1420); border: 1px solid var(--lk-bd2); border-radius: 8px;
  color: var(--lk-tx); font: inherit; font-size: 13px; padding: 9px 10px; outline: none; min-height: 38px;
}
.lk-in input:focus, .lk-ref:focus, .lk-form input:focus, .lk-form textarea:focus { border-color: var(--lk-ac); box-shadow: 0 0 0 3px var(--pv-accent-glow, rgba(45, 212, 191, .18)); }
.lk-in input::placeholder, .lk-ref::placeholder, .lk-form ::placeholder { color: var(--pv-text-dim, #556b82); }
.lk-pin { width: 38px; height: 38px; border-radius: 8px; background: var(--lk-bg2); border: 1px solid var(--lk-bd2); display: grid; place-items: center; color: var(--lk-mu) !important; }
.lk-pin:hover, .lk-pin[aria-pressed=true] { color: var(--lk-ac) !important; border-color: var(--lk-ac); }
.lk-pt.is-picking input { border-color: var(--lk-ac); border-style: dashed; }
.lk-swap { position: absolute; right: 46px; top: 50%; transform: translateY(-50%); z-index: 2; width: 26px; height: 26px; border-radius: 50%;
  background: var(--lk-bg); border: 1px solid var(--lk-bd2); font-size: 13px !important; line-height: 1; color: var(--lk-mu) !important; padding: 0; }
.lk-swap:hover { color: var(--lk-tx) !important; border-color: var(--lk-ac); }
.lk-sug { position: absolute; z-index: 5; left: 0; right: 0; top: calc(100% + 4px); background: var(--lk-bg); border: 1px solid var(--lk-bd2);
  border-radius: 8px; box-shadow: 0 12px 28px rgba(0, 0, 0, .45); padding: 4px; max-height: 300px; overflow-y: auto; }
.lk-opt { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 8px; width: 100%; text-align: left;
  background: none; border: 0; border-radius: 6px; padding: 7px 8px; }
.lk-opt.is-hi, .lk-opt:hover { background: var(--lk-bg2); }
.lk-ty { grid-row: span 2; align-self: center; font: 600 9.5px/1 'JetBrains Mono', ui-monospace, monospace; text-transform: uppercase; letter-spacing: .04em;
  padding: 4px 5px; border-radius: 4px; color: var(--lk-mu); border: 1px solid var(--lk-bd2); min-width: 64px; text-align: center; }
.lk-ty--land { color: #7dd3fc; border-color: rgba(125, 211, 252, .4); } .lk-ty--city { color: var(--lk-ac); border-color: rgba(45, 212, 191, .4); }
.lk-ty--fac { color: #c4b5fd; border-color: rgba(196, 181, 253, .4); } .lk-ty--ix { color: #fbbf24; border-color: rgba(251, 191, 36, .4); }
.lk-ty--xy { color: var(--lk-z); border-color: rgba(244, 114, 182, .4); }
.lk-on { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lk-os { color: var(--lk-mu); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.lk-opts { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 12px 0 8px 36px; color: var(--lk-mu); font-size: 12px; }
.lk-seg { display: inline-flex; border: 1px solid var(--lk-bd2); border-radius: 8px; overflow: hidden; }
.lk-seg button { background: none; border: 0; padding: 5px 10px; font-size: 12px !important; color: var(--lk-mu) !important; }
.lk-seg button + button { border-left: 1px solid var(--lk-bd2); }
.lk-seg button.is-on { background: var(--pv-accent-glow, rgba(45, 212, 191, .18)); color: var(--lk-tx) !important; font-weight: 700; }
.lk-gc { color: var(--lk-mu); font-size: 12px; margin: 4px 0 8px; min-height: 1px; }
.lk-gc b { color: var(--lk-tx); font-weight: 600; }
.lk-empty { color: var(--lk-mu); padding: 14px 4px; line-height: 1.55; }
.lk-empty b { color: var(--lk-tx); }

.lk-card { display: block; width: 100%; text-align: left; background: var(--lk-bg2); border: 1px solid var(--lk-bd); border-left: 3px solid var(--lk-c);
  border-radius: 9px; padding: 10px 12px; margin: 0 0 8px; }
.lk-card:hover { border-color: var(--lk-bd2); border-left-color: var(--lk-c); }
.lk-card.is-sel { border-color: var(--lk-c); background: color-mix(in srgb, var(--lk-c) 9%, var(--lk-bg2)); }
.lk-ct { display: flex; align-items: center; gap: 7px; min-width: 0; }
.lk-dot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--lk-c); }
.lk-cn { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lk-badge { flex: none; font: 600 9.5px/1 'JetBrains Mono', ui-monospace, monospace; text-transform: uppercase; letter-spacing: .04em; padding: 3px 5px;
  border-radius: 4px; background: rgba(45, 212, 191, .16); color: var(--lk-ac); }
.lk-badge--soon { background: rgba(251, 191, 36, .16); color: #fbbf24; }
.lk-cm { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin: 5px 0 2px 16px; font-variant-numeric: tabular-nums; }
.lk-cm b { font-size: 15px; }
.lk-cm span { color: var(--lk-tx); }
.lk-cm .lk-dim, .lk-dim { color: var(--lk-mu); font-size: 11.5px; }
.lk-cx { display: block; margin-left: 16px; color: var(--lk-mu); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lk-legs { list-style: none; margin: 9px 0 0 16px; padding: 8px 0 0; border-top: 1px dashed var(--lk-bd2); counter-reset: lk; }
.lk-leg { display: grid; grid-template-columns: 1fr auto; column-gap: 8px; padding: 3px 0 3px 16px; position: relative; font-size: 12px; }
.lk-leg::before { content: ''; position: absolute; left: 2px; top: 9px; width: 7px; height: 7px; border-radius: 50%; background: var(--lk-c); }
.lk-leg--land::before { background: none; border: 1.5px dashed var(--lk-mu); width: 5px; height: 5px; }
.lk-lk { font-weight: 600; } .lk-lk i { color: #fbbf24; font-style: normal; }
.lk-lw { grid-column: 1; color: var(--lk-mu); font-size: 11.5px; }
.lk-lkm { grid-column: 2; grid-row: 1 / span 2; align-self: center; font-variant-numeric: tabular-nums; color: var(--lk-tx); }
.lk-note { color: var(--pv-text-dim, #556b82); font-size: 11px; line-height: 1.5; margin: 6px 2px 10px; }

.lk-foot { border-top: 1px solid var(--lk-bd); padding: 10px 14px 12px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.lk-ref { min-height: 34px !important; padding: 7px 10px !important; font-size: 12px !important; }
.lk-acts { display: flex; gap: 6px; flex-wrap: wrap; }
.lk-btn { background: var(--lk-bg2, #162638); border: 1px solid var(--pv-border-hi, #2a4261); border-radius: 8px; padding: 8px 12px; font-size: 12.5px !important; font-weight: 600; }
.lk-btn:hover:not(:disabled) { border-color: var(--pv-accent, #2dd4bf); }
.lk-btn--pri { background: var(--pv-accent, #2dd4bf); border-color: var(--pv-accent, #2dd4bf); color: #06090e !important; }
.lk-btn--pri:hover:not(:disabled) { filter: brightness(1.08); }
.lk-attr { color: var(--pv-text-dim, #556b82); font-size: 10.5px; line-height: 1.4; }
.lk-open-btn svg { color: var(--pv-accent, #2dd4bf); vertical-align: -2px; }
.lk-open-btn.is-active { background: rgba(45, 212, 191, .16) !important; border-color: #2dd4bf !important; color: #e6edf3 !important; font-weight: 700; }

#lk-hint { position: fixed; z-index: 45; left: 50%; top: 84px; transform: translateX(-50%); background: rgba(8, 10, 14, .94); color: #d8e4f4;
  border: 1px solid var(--pv-accent, #2dd4bf); border-radius: 999px; padding: 8px 14px; font: 12.5px/1.3 var(--pv-sans, system-ui, sans-serif);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .4); cursor: pointer; white-space: nowrap; text-align: center; }
#lk-hint b { color: var(--pv-accent, #2dd4bf); }
#lk-hint span { margin-left: 10px; color: #7a92aa; text-decoration: underline; }
body.lk-on #pv-globe canvas { cursor: default; }
body.lk-on #lk-panel.is-picking ~ #pv-globe canvas, body.lk-on:has(#lk-panel.is-picking) #pv-globe canvas { cursor: crosshair !important; }

/* suggest a cable */
#lk-modal { white-space: normal; text-align: left; position: fixed; inset: 0; z-index: 60; background: rgba(2, 4, 8, .62); display: grid; place-items: center; padding: 16px; }
.lk-form { width: min(480px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; box-sizing: border-box; background: var(--pv-surface, #111d2d);
  border: 1px solid var(--pv-border-hi, #2a4261); border-radius: 12px; padding: 16px; color: var(--pv-text, #d8e4f4);
  font: 13px/1.45 var(--pv-sans, system-ui, sans-serif); position: relative; box-shadow: 0 24px 60px rgba(0, 0, 0, .5); }
.lk-fh { font-size: 15px; padding-right: 36px; }
.lk-fh .lk-x { right: 8px; top: 8px; }
.lk-fp { color: var(--pv-text-muted, #7a92aa); font-size: 12px; margin: 4px 0 12px; }
.lk-kind { display: flex; gap: 16px; margin-bottom: 10px; }
.lk-kind label { display: flex; gap: 6px; align-items: center; cursor: pointer; }
.lk-kind input { width: auto; min-height: 0; accent-color: var(--pv-accent, #2dd4bf); }
.lk-f { display: grid; gap: 4px; margin-bottom: 10px; font-size: 12px; color: var(--pv-text-muted, #7a92aa); }
.lk-f2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.lk-lands { display: grid; gap: 6px; }
.lk-land { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px; }
.lk-lc { color: var(--pv-text-dim, #556b82); font: 11px/1 'JetBrains Mono', ui-monospace, monospace; }
.lk-add { justify-self: start; padding: 5px 10px; font-size: 12px !important; margin-top: 2px; }
.lk-hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.lk-fmsg { min-height: 18px; font-size: 12px; margin: 2px 0 10px; }
.lk-fmsg.is-err { color: #f87171; } .lk-fmsg.is-ok { color: var(--pv-accent, #2dd4bf); }

/* phone: a bottom sheet; tap its head to fold it and see the globe */
@media (max-width: 640px) {
  body.lk-on #pv-globe { bottom: var(--lk-sheet-h, 0px); }
  #lk-panel { left: 0; right: 0; bottom: 0; top: auto; width: auto; max-width: none; max-height: 58vh; border-radius: 16px 16px 0 0;
    border-left: 0; border-right: 0; border-bottom: 0; z-index: 70; padding-bottom: env(safe-area-inset-bottom, 0); }
  #lk-panel.is-peek { max-height: none; bottom: 0; }
  #lk-panel.is-picking .lk-body > :not(.lk-pts), #lk-panel.is-picking .lk-foot { display: none; }
  .lk-grab { display: block; width: 40px; height: 4px; border-radius: 2px; background: var(--pv-border-hi, #2a4261); margin: -6px auto 8px; }
  .lk-head { padding: 12px 88px 8px 16px; }
  .lk-min, .lk-x { width: 40px; height: 40px; }
  .lk-min { right: 48px; }
  .lk-in input { font-size: 16px; min-height: 44px; }            /* 16 px: iOS does not zoom into the field */
  .lk-pin { width: 44px; height: 44px; }
  .lk-pt { grid-template-columns: 28px 1fr 44px; }
  .lk-swap { right: 52px; }
  .lk-ref { display: none; }
  .lk-attr { font-size: 10px; }
  .lk-acts .lk-btn { flex: 1 1 auto; padding: 10px 8px; }
  .lk-opt { padding: 10px 8px; }
  #lk-hint { top: auto; bottom: calc(var(--lk-sheet-h, 160px) + 12px); max-width: calc(100vw - 32px); }
  .lk-form input, .lk-form textarea { font-size: 16px; }
  body.lk-on .pvm-sheet-host, body.lk-on #pv-details { display: none !important; }
}

/* the route sheet: white paper, ink friendly */
#lk-print { display: none; }
@media print {
  body.lk-printing { background: #fff !important; }
  body.lk-printing > *:not(#lk-print) { display: none !important; }
  body.lk-printing #lk-print { display: block !important; }
  .lks { white-space: normal; color: #1c2430; font: 10pt/1.45 -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .lks-head { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 2px solid #0d9488; padding-bottom: 3mm; margin-bottom: 4mm; color: #5a6372; }
  .lks-head b { color: #0d9488; font-size: 13pt; }
  .lks-head > div:first-child { font-size: 12pt; color: #1c2430; }
  .lks-pts { display: grid; grid-template-columns: 1fr 1fr; gap: 6mm; margin-bottom: 4mm; }
  .lks-pt { display: flex; gap: 3mm; align-items: flex-start; }
  .lks-pt b { display: block; font-size: 11pt; }
  .lks-pt span { color: #5a6372; font-size: 9pt; }
  .lks-tag { flex: none; display: inline-grid; place-items: center; width: 7mm; height: 7mm; border-radius: 50%; color: #fff; font-weight: 800; font-size: 10pt; }
  .lks-tag--A { background: #0d9488; } .lks-tag--Z { background: #db2777; }
  .lks-sum { display: grid; grid-template-columns: 2.2fr 1fr 1fr 1fr 1fr; border: 1px solid #d6cfc0; border-radius: 2mm; margin-bottom: 4mm; }
  .lks-sum > div { padding: 2.5mm 3mm; border-left: 1px solid #e8e3d8; }
  .lks-sum > div:first-child { border-left: 0; }
  .lks-sum span { display: block; color: #5a6372; font-size: 8pt; text-transform: uppercase; letter-spacing: .04em; }
  .lks-sum b { font-size: 11.5pt; }
  .lks-map { display: block; width: 100%; height: auto; border: 1px solid #d6cfc0; border-radius: 2mm; margin-bottom: 5mm; }
  .lks-sea { fill: #eef4f7; } .lks-landp { fill: #dde3e8; stroke: #b9c3cc; stroke-width: .6; }
  .lks-o { fill: none; stroke: #9aa7b3; stroke-width: 1.2; opacity: .8; }
  .lks-r { fill: none; stroke: #0d9488; stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; }
  .lks-l { fill: none; stroke: #5a6372; stroke-width: 1.8; stroke-dasharray: 6 4; }
  .lks-ld { fill: #fff; stroke: #0d9488; stroke-width: 2; }
  .lks-lt { font: 600 13px sans-serif; fill: #1c2430; paint-order: stroke; stroke: #fff; stroke-width: 3px; }
  .lks-az { stroke: #fff; stroke-width: 2.5; } .lks-az--A { fill: #0d9488; } .lks-az--Z { fill: #db2777; }
  .lks-azt { font: 800 12px sans-serif; fill: #fff; text-anchor: middle; }
  .lks h3 { font-size: 10.5pt; margin: 4mm 0 2mm; }
  .lks-t { width: 100%; border-collapse: collapse; font-size: 9pt; break-inside: auto; }
  .lks-t th { text-align: left; color: #5a6372; font-weight: 600; border-bottom: 1px solid #a99e86; padding: 1.5mm 2mm; }
  .lks-t td { border-bottom: 1px solid #e8e3d8; padding: 1.5mm 2mm; vertical-align: top; }
  .lks-t tr { break-inside: avoid; }
  .lks-t .n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
  .lks-t tr.is-sel td { background: #e6f4f2; font-weight: 600; }
  .lks-t em { color: #b45309; font-style: normal; font-size: 8pt; }
  .lks-land td { color: #5a6372; }
  .lks-note { color: #5a6372; font-size: 8.5pt; margin-top: 4mm; }
  .lks-src { color: #8b93a1; font-size: 8pt; }
}
