/* ─── links module styles (v10.20) ────────────────────────────────
   Panel chrome (overlay, header, close) comes from module-lib.css.
   This file styles only content INSIDE the panel body and dialogs. */

/* two-pane layout */
.links-two-pane {
  display: flex;
  width: 100%;
  height: 100%;
  font-family: var(--mono, monospace);
  overflow: hidden;
}
.links-tree {
  width: 220px;
  flex-shrink: 0;
  border-right: 1px solid var(--accent2);
  overflow-y: auto;
  padding: 6px 0;
}
.links-pane-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

/* tree items */
.links-tree-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  cursor: pointer;
  text-decoration: none;
  color: var(--fg);
  font-size: 0.88em;
  min-height: 36px;
}
.links-tree-item:hover { background: rgba(176,230,176,0.05); }
.links-tree-item.active {
  background: rgba(176,230,176,0.1);
  color: var(--accent);
  font-weight: bold;
}
.links-count {
  font-size: 0.78em;
  color: var(--dim);
  background: rgba(176,230,176,0.06);
  padding: 1px 6px;
  border-radius: 8px;
}
.links-tree-divider {
  border-top: 1px solid var(--accent2);
  margin: 6px 0;
}
.links-folder-add-btn {
  color: var(--brass, #ffd070);
  border-style: dashed;
}

/* links folder rows with inline move button */
.links-tree-row {
  display: flex;
  align-items: stretch;
  min-height: 36px;
}
.links-tree-row.active { background: rgba(176,230,176,0.1); }
.links-tree-row .links-tree-item {
  flex: 1;
  min-height: auto;
  padding-right: 4px;
}
.links-tree-row .links-tree-item:hover { background: rgba(176,230,176,0.05); }
.links-tree-row.active .links-tree-item {
  color: var(--accent);
  font-weight: bold;
  background: transparent;
}
.links-folder-move-btn {
  cursor: pointer;
  text-decoration: none;
  color: var(--dim);
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  font-size: 0.95em;
  flex-shrink: 0;
}
.links-folder-move-btn:hover {
  color: var(--accent);
  background: rgba(176,230,176,0.08);
}

/* right pane toolbar */
.links-toolbar {
  display: flex;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--accent2);
  align-items: center;
}
.links-search {
  flex: 1;
  background: transparent;
  border: 1px solid var(--accent2);
  color: var(--fg);
  padding: 6px 10px;
  font-family: var(--mono, monospace);
  font-size: 0.9em;
  border-radius: 2px;
  min-width: 0;
}
.links-search:focus {
  outline: none;
  border-color: var(--accent);
}
.links-toolbar-btn {
  cursor: pointer;
  text-decoration: none;
  padding: 5px 12px;
  border: 1px solid var(--accent2);
  color: var(--accent);
  font-size: 0.88em;
  border-radius: 2px;
  white-space: nowrap;
}
.links-toolbar-btn:hover {
  background: rgba(176,230,176,0.1);
  border-color: var(--accent);
}

.links-current-folder {
  padding: 6px 12px;
  font-size: 0.85em;
  color: var(--dim);
  border-bottom: 1px solid var(--accent2);
  font-style: italic;
}
.links-folder-action {
  cursor: pointer;
  text-decoration: none;
  padding: 2px 6px;
  font-size: 0.84em;
  color: var(--dim);
  margin-left: 4px;
}
.links-folder-action:hover { color: var(--accent); }

.links-list {
  list-style: none;
  padding: 0;
  margin: 0;
  flex: 1;
  overflow-y: auto;
}
.links-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(176,230,176,0.06);
  position: relative;
}
.links-row:hover { background: rgba(176,230,176,0.04); }
.links-row.selected {
  background: rgba(176,230,176,0.12);
  border-left: 3px solid var(--accent);
  padding-left: 9px;
}
.links-row.is-private {
  background: rgba(255,208,112,0.03);
}
.links-favicon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95em;
}
.links-favicon img {
  width: 18px;
  height: 18px;
  border-radius: 2px;
}
.links-link {
  flex: 1;
  min-width: 0;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 1px;
  color: var(--fg);
}
.links-link:hover .links-name { color: var(--accent); }
.links-name {
  font-size: 0.92em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.links-host {
  font-size: 0.78em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.links-row-meta {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.links-badge {
  font-size: 0.8em;
}
.links-fav {
  cursor: pointer;
  text-decoration: none;
  padding: 4px 6px;
  color: var(--dim);
  font-size: 0.95em;
}
.links-fav:hover { color: var(--brass, #ffd070); }
.links-fav.is-fav { color: var(--brass, #ffd070); }
.links-row-action {
  cursor: pointer;
  text-decoration: none;
  padding: 2px 6px;
  color: var(--dim);
  font-size: 0.82em;
  border-radius: 2px;
}
.links-row-action:hover {
  color: var(--accent);
  background: rgba(176,230,176,0.08);
}
.links-row-del:hover { color: #e07a7a; background: rgba(224,122,122,0.08); }
.links-empty {
  padding: 24px 12px;
  text-align: center;
  font-style: italic;
}
.links-help {
  padding: 6px 12px;
  font-size: 0.75em;
  border-top: 1px solid var(--accent2);
  background: rgba(0,0,0,0.15);
  word-break: break-word;
}

/* favorite slot badge on link rows */
.links-slot-badge {
  display: inline-block;
  background: #ffcc66;
  color: #1a1a1a;
  font-size: 0.72em;
  font-weight: bold;
  padding: 1px 5px;
  border-radius: 8px;
  margin-left: 6px;
  vertical-align: middle;
  font-family: var(--mono, monospace);
}

/* link add/edit dialog (inside ml-submodal) */
.links-dialog .ml-submodal-inner {
  max-width: 500px;
}
.links-cb-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  padding: 4px 0;
}
.links-cb-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin: 0;
  cursor: pointer;
}
.links-cb-row label {
  display: inline;
  margin: 0;
  color: var(--fg);
  font-size: 0.92em;
  cursor: pointer;
  flex: 1;
}
.links-dialog-actions {
  margin-top: 14px;
  display: flex;
  gap: 8px;
}
.links-dialog-actions .btn {
  background: transparent;
  border: 1px solid var(--accent2);
  color: var(--fg);
  padding: 6px 14px;
  font-family: var(--mono, monospace);
  font-size: 0.88em;
  cursor: pointer;
  border-radius: 2px;
}
.links-dialog-actions .btn:hover {
  background: rgba(176,230,176,0.1);
  border-color: var(--accent);
}
.links-dialog-actions .btn.primary {
  color: var(--accent);
  border-color: var(--accent);
}
.links-dialog-actions .btn.primary:hover {
  background: rgba(176,230,176,0.15);
}

/* mobile */
@media (max-width: 720px) {
  .links-two-pane { flex-direction: column; }
  .links-tree {
    width: 100%;
    max-height: 30%;
  }
  .links-help { display: none; }
}
