/* ---------- «Ссылки-метки» (links.js): конструктор ссылки + «Ваши метки» ---------- */
.lk-screen { container: lk / inline-size; }
.lk-card { padding: 18px; margin-bottom: 16px; border-radius: 16px; background: var(--panel-2); border: 1px solid var(--border); }
.lk-card:last-child { margin-bottom: 0; }
.lk-card h3 { margin: 0; font-size: 15px; font-weight: 700; }
.lk-lead { margin: 6px 0 2px; color: var(--text-dim); font-size: 13.5px; line-height: 1.5; }
.lk-lead code { background: var(--panel-3); color: var(--text); }

.lk-form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 16px; max-width: 560px; }
.lk-form.two { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: none; }
.lk-f { min-width: 0; }
.lk-f input { font-family: "IBM Plex Mono", ui-monospace, monospace; }
.lk-f input[aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 18%, transparent); }
.lk-msg { min-height: 18px; margin-top: 6px; color: var(--text-faint); font-size: 12.5px; line-height: 1.4; }
.lk-msg.bad { color: var(--danger); font-weight: 600; }

/* готовая ссылка */
.lk-out { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 14px; }
.lk-link { flex: 1 1 300px; min-width: 0; padding: 11px 14px; border-radius: 12px; background: var(--panel);
  border: 1px dashed color-mix(in srgb, var(--accent) 45%, var(--border-2)); color: var(--text-dim);
  font: 500 13.5px/1.45 "IBM Plex Mono", ui-monospace, monospace; overflow-wrap: anywhere; user-select: all; }
.lk-link b { color: var(--accent-text); font-weight: 600; }
.lk-link.off { opacity: .5; border-style: solid; border-color: var(--border); }
.lk-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.lk-acts button { display: inline-flex; align-items: center; gap: 8px; }
.lk-acts button:disabled { opacity: .5; cursor: default; box-shadow: none; }
.lk-open { display: inline-flex; align-items: center; justify-content: center; padding: 8px 15px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--panel-3); color: var(--text); font-size: 14px; font-weight: 500; text-decoration: none; }
.lk-open:hover { border-color: var(--accent); }
.lk-open:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-soft); border-color: var(--accent); }
.lk-note { width: 100%; margin: 0; color: var(--text-dim); font-size: 12.5px; line-height: 1.45; }
.lk-note.bad { color: var(--text-faint); }
.lk-nouser { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; width: 100%; padding: 12px 14px; border-radius: 12px;
  font-size: 13.5px; line-height: 1.45; color: var(--text);
  background: color-mix(in srgb, var(--warn) 10%, transparent); border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent); }
.lk-nouser span { flex: 1 1 220px; min-width: 0; }
.lk-clip { position: fixed; top: 0; left: 0; width: 1px; height: 1px; padding: 0; border: 0; opacity: 0; pointer-events: none; }

/* «Ваши метки» */
.lk-sec-h { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.lk-sec-h span { color: var(--text-faint); font-size: 12.5px; font-weight: 600; }
.lk-row { display: grid; align-items: center; gap: 12px; padding: 10px 6px; font-size: 13px;
  /* колонка кнопок одной ширины у шапки и строк — каждая строка своя сетка, auto их разъедет */
  grid-template-columns: minmax(0, 2fr) repeat(4, minmax(0, 1fr)) 212px; border-bottom: 1px solid var(--border); }
.lk-row:last-child { border-bottom: 0; }
.lk-rhead { padding-block: 6px 8px; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-faint); }
.lk-tag-c { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lk-tag-c b { font-weight: 600; color: var(--text); }
.lk-num { text-align: right; font: 500 13px "IBM Plex Mono", ui-monospace, monospace; font-variant-numeric: tabular-nums; color: var(--text); }
.lk-rhead .lk-num { font: inherit; color: inherit; }
.lk-row.is-direct .lk-num { color: var(--text-dim); }
.lk-row-acts { display: flex; justify-content: flex-end; gap: 6px; }
.lk-row-acts button { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.lk-empty { padding: 16px; border: 1px dashed var(--border-2); border-radius: 12px; color: var(--text-dim); font-size: 13.5px; line-height: 1.5; }
.lk-empty span { display: inline-block; margin-top: 6px; color: var(--text-faint); }
.lk-empty b { color: var(--text); font-family: "IBM Plex Mono", ui-monospace, monospace; }

/* узко: строка метки — карточка с подписями */
@container lk (max-width: 640px) {
  .lk-form.two { grid-template-columns: minmax(0, 1fr); }
  .lk-acts { width: 100%; }
  .lk-acts > * { flex: 1 1 140px; justify-content: center; }
  .lk-rhead { display: none; }
  .lk-row { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px 10px; padding: 12px; margin-bottom: 8px;
    border: 1px solid var(--border); border-radius: 12px; background: var(--panel); }
  .lk-row:last-child { border-bottom: 1px solid var(--border); margin-bottom: 0; }
  .lk-tag-c { grid-column: 1 / -1; white-space: normal; overflow-wrap: anywhere; }
  .lk-num { display: grid; gap: 2px; text-align: left; }
  .lk-num::before { content: attr(data-l); font: 700 11px "Manrope", system-ui, sans-serif; letter-spacing: .04em;
    text-transform: uppercase; color: var(--text-faint); }
  .lk-row-acts { grid-column: 1 / -1; justify-content: stretch; }
  .lk-row-acts button { flex: 1; justify-content: center; }
}
@container lk (max-width: 420px) {
  .lk-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (hover: none), (pointer: coarse) {
  .lk-acts button, .lk-open, .lk-row-acts button, .lk-nouser button { min-height: 40px; }
}
@media (max-width: 820px) {
  .lk-card { padding: 14px; }
  .lk-screen input, .lk-screen select { font-size: 16px; }
}
