/* Link anchor and its panel (web/link_anchor.js). */
html:root .link-anchor {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 20px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--scs-radius-s);
  background: transparent;
  color: var(--scs-ink-disabled);
  vertical-align: middle;
  flex: none;
}
html:root .link-anchor:hover:not(:disabled) {
  color: var(--scs-accent);
  border-color: var(--scs-line);
  background: var(--scs-surface);
}
html:root .link-anchor:focus-visible {
  outline: 2px solid var(--scs-focus);
  outline-offset: 1px;
}
html:root .link-anchor[aria-pressed='true'] {
  color: var(--scs-accent);
  border-color: var(--scs-accent);
  background: var(--scs-accent-soft);
}
html:root .link-anchor:disabled {
  visibility: hidden;
}

/* Table rows: the anchor stands left of the row's checkbox. */
html:root .grid td.row-control.has-anchor {
  padding-left: 20px;
}
html:root .grid td.row-control .link-anchor {
  position: absolute;
  left: 2px;
  top: 50%;
  transform: translateY(-50%);
}
.req-id-cell,
.object-meta-anchor {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.link-anchor-panel {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 30;
  width: min(420px, calc(100vw - 32px));
  padding: 14px 16px 12px;
  border: 1px solid var(--scs-line);
  border-radius: var(--scs-radius-s);
  background: var(--scs-surface);
  color: var(--scs-ink);
  box-shadow: var(--scs-shadow-pop);
}
.link-anchor-panel header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.link-anchor-panel h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 650;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.link-anchor-panel header button {
  border: 0;
  background: transparent;
  padding: 0 4px;
  font-size: 18px;
  line-height: 1;
  color: var(--scs-ink-3);
}
.link-anchor-detail {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 4px 0 10px;
  font-size: 12px;
  color: var(--scs-ink-3);
}
.link-anchor-chip {
  padding: 1px 6px;
  border-radius: var(--scs-radius-s);
  background: var(--scs-accent-soft);
  color: var(--scs-ink-2);
}
.link-anchor-role {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  color: var(--scs-ink-3);
}
.link-anchor-role select {
  flex: 1;
  font-size: 13px;
  padding: 6px 8px;
  background: var(--scs-surface);
}
.link-anchor-hint {
  margin: 10px 0 0;
  font-size: 11px;
  line-height: 1.5;
  color: var(--scs-ink-3);
}

/* Marked as target (Ctrl+click): dashed, so sources and targets read apart in every list. */
html:root .link-anchor[data-link-mark='target'] {
  color: var(--scs-ok);
  border-color: var(--scs-ok);
  border-style: dashed;
  background: var(--scs-ok-soft);
}
.link-anchor-groups {
  display: grid;
  gap: 6px;
  margin: 6px 0 10px;
}
.link-anchor-group {
  display: grid;
  grid-template-columns: 52px 1fr;
  align-items: baseline;
  gap: 6px;
  font-size: 12px;
}
.link-anchor-label {
  color: var(--scs-ink-3);
  font-weight: 600;
}
.link-anchor-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-width: 0;
}
.link-anchor-chip {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.link-anchor-target .link-anchor-chip {
  background: var(--scs-ok-soft);
  outline: 1px dashed var(--scs-ok);
  outline-offset: -1px;
}
.link-anchor-chip button {
  border: 0;
  background: transparent;
  padding: 0 2px;
  font-size: 13px;
  line-height: 1;
  color: var(--scs-ink-3);
}
.link-anchor-chip button:hover {
  color: var(--scs-ink);
}
.link-anchor-empty {
  color: var(--scs-ink-3);
  font-style: italic;
}
.link-anchor-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}
