/* Lightning: the Lightning section of an on-chain BTC account (wallets,
   on-chain / Lightning split, time-locked force-close funds) and a wallet's
   Channels section. Cards reuse the debt-position card (css/debt.css). */
.ln-section {
  margin: 1.1rem 0 0.25rem; padding: 0.6rem 1rem 0.4rem;
  border: 1px solid var(--border); border-radius: 14px;
  background: var(--surface-2); min-width: 0;
}
.ln-section-head { display: flex; align-items: center; gap: 0.55rem; margin: 0 0 0.35rem; min-width: 0; }
.ln-section-head .section-title { margin: 0; display: inline-flex; align-items: center; gap: 0.55rem; }
.ln-section-head .section-title::before {
  content: ''; flex: 0 0 auto; width: 0.42rem; height: 0.42rem; border-radius: 50%;
  background: var(--amber, #f2a900); box-shadow: 0 0 0 3px var(--amber-bg, rgba(242, 169, 0, 0.18));
}
.ln-section-head .section-actions { margin-left: auto; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.ln-split {
  display: flex; flex-wrap: wrap; gap: 0.35rem 1.1rem; margin: 0.15rem 0 0.5rem;
  font-variant-numeric: tabular-nums; min-width: 0;
}
.ln-split-part { display: inline-flex; flex-direction: column; min-width: 0; }
.ln-split-label { color: var(--muted); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; }
.ln-msat { opacity: 0.5; font-size: 0.85em; }
.ln-locked { margin: 0.2rem 0; color: var(--muted); font-size: 0.85rem; overflow-wrap: anywhere; }
.ln-wallet-note { margin: 0 0 0.35rem; color: var(--muted); font-size: 0.85rem; }
.ln-wallet-card { cursor: pointer; }
.ln-wallet-card:focus-visible { outline: 2px solid var(--accent, currentColor); outline-offset: 2px; }
.ln-ids { color: var(--muted); font-size: 0.85rem; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.ln-chip {
  display: inline-block; flex: 0 0 auto; margin-left: 0.4rem; padding: 0.05rem 0.5rem;
  border: 1px solid var(--border); border-radius: 999px; font-size: 0.72rem; line-height: 1.5;
  color: var(--muted); white-space: nowrap; max-width: 12rem; overflow: hidden; text-overflow: ellipsis;
}
.ln-chip.is-open { color: var(--green); border-color: var(--green-line, var(--border)); }
.ln-chip.is-closing { color: var(--amber, #b8860b); }
.ln-chip.is-closed { opacity: 0.75; }
.ln-channel-card .debt-position-top, .ln-wallet-card .debt-position-top { flex-wrap: wrap; }
.ln-channel-actions { margin-left: auto; }
@media (max-width: 520px) {
  .ln-section { padding: 0.55rem 0.8rem 0.35rem; }
  .ln-split { gap: 0.3rem 0.9rem; }
}
.acct-ln-indicator { color: var(--amber); border-color: var(--amber-line); background: var(--amber-bg); }

/* The Lightning channel record: its panel replaces the record form's fields
   while the type is selected (the type, account and save button stay). */
#trade-form.is-channel > :not(.ch-keep) { display: none !important; }
.ln-panel { display: grid; gap: 0.2rem; min-width: 0; }
.ln-panel [hidden] { display: none !important; }
.ln-field { display: grid; gap: 0.2rem; min-width: 0; }
.ln-intro { margin: 0.1rem 0 0.35rem; color: var(--muted); font-size: 0.82rem; }
.ln-preview { margin: 0.35rem 0 0; color: var(--muted); font-size: 0.85rem; overflow-wrap: anywhere; }
.ln-edit-actions { display: flex; justify-content: flex-start; margin-top: 0.35rem; }
.ln-action-toggle {
  position: relative; isolation: isolate;
  display: grid; grid-template-columns: repeat(4, 1fr);
  padding: 3px; margin: 0.35rem 0 0.25rem;
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface);
}
.ln-action-toggle::before {
  content: ""; position: absolute; z-index: -1; top: 3px; bottom: 3px; left: 3px;
  width: calc((100% - 6px) / 4); border-radius: 999px;
  background: var(--surface-4); box-shadow: inset 0 0 0 1px var(--border-strong);
  transition: transform 0.3s var(--ease);
}
.ln-action-toggle:has(button:nth-child(2)[aria-checked="true"])::before { transform: translateX(100%); }
.ln-action-toggle:has(button:nth-child(3)[aria-checked="true"])::before { transform: translateX(200%); }
.ln-action-toggle:has(button:nth-child(4)[aria-checked="true"])::before { transform: translateX(300%); }
.ln-action-toggle button {
  min-height: 2.1rem; padding: 0.3rem 0.4rem; border: none; border-radius: 999px; min-width: 0;
  background: transparent; color: var(--muted); font-size: 0.8rem; font-weight: 600; letter-spacing: 0.02em;
}
.ln-action-toggle button:hover { background: transparent; color: var(--text); }
.ln-action-toggle button[aria-checked="true"] { color: var(--text); }
.ln-action-toggle button:disabled { cursor: default; }
.ln-action-toggle button:disabled:not([aria-checked="true"]) { opacity: 0.45; }
@media (prefers-reduced-motion: reduce) { .ln-action-toggle::before { transition: none; } }
.ln-panel .ln-field + .ln-field, .ln-panel [data-ln-for] + .ln-field, .ln-panel .ln-field + [data-ln-for] { margin-top: 0.3rem; }
.ln-panel [data-ln-for], .ln-panel [data-ln-ids] { display: grid; gap: 0.5rem; }

/* Line editors: one row per account / wallet taking part in a channel
   event (js/ui/lightning-lines.js). */
.ln-lines { display: grid; gap: 0.45rem; min-width: 0; }
.ln-line {
  display: grid; gap: 0.35rem; min-width: 0;
  padding: 0.5rem; border: 1px solid var(--border); border-radius: 10px; background: var(--surface);
}
.ln-line-main, .ln-line-sub, .ln-line-fees { display: flex; align-items: center; gap: 0.4rem; min-width: 0; }
.ln-line-main > select, .ln-line-sub > select { flex: 1 1 0; min-width: 0; }
.ln-line-main > input { flex: 0 1 9rem; min-width: 0; }
.ln-line-sub > input, .ln-line-fees > input { flex: 1 1 0; min-width: 0; }
.ln-line-into { flex: 0 0 auto; color: var(--muted); font-size: 0.8rem; }
.ln-line-name-text { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; font-size: 0.88rem; }
.ln-line-del { flex: 0 0 auto; min-width: 2rem; padding: 0.2rem 0.5rem; }
.ln-line input[readonly] { color: var(--muted); }
.ln-lines-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.ln-split-btn { margin-left: auto; }
.ln-period-inputs { display: flex; align-items: center; gap: 0.4rem; min-width: 0; }
.ln-period-inputs > input { flex: 1 1 0; min-width: 0; }
.ln-node-head { margin: 0.35rem 0 0; color: var(--muted); font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; overflow-wrap: anywhere; }
.ln-share { margin: 0.1rem 0; font-size: 0.85rem; overflow-wrap: anywhere; }
.ln-backing { margin: 0.2rem 0; color: var(--muted); font-size: 0.85rem; overflow-wrap: anywhere; }
