/* The Import page and the Block's full page: a card, the tabs, the address line, the kinds the console reads, the preview's choices and the steps. */

.card { border: 1px solid var(--ln); border-radius: 10px; background: var(--pn); min-width: 0; }
.card[hidden] { display: none; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0; padding: 12px 18px; border-bottom: 1px solid var(--ln); font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--dim); }
.card-body { display: flex; flex-direction: column; gap: 14px; padding: 16px 18px 18px; }
.card-body > .empty { padding: 4px 0; }
.card-sum { margin-left: auto; text-transform: none; letter-spacing: 0; font-size: 12px; font-weight: 500; }

.import-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; padding: 0 20px 24px; }
.import-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

.tabs { display: flex; border-bottom: 1px solid var(--ln); }
.tab { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 18px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--dim); font-weight: 600; cursor: pointer; }
.tab:hover { color: var(--tx); }
.tab[aria-selected="true"] { color: var(--tx); border-bottom-color: var(--accm); }
.tab-body { display: flex; flex-direction: column; gap: 14px; padding: 16px 18px 18px; }
.tab-body[hidden] { display: none; }

.address-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.address-line .input { flex: 1 1 220px; width: auto; }
.detected { display: inline-flex; min-width: 0; }
.is-problem { color: var(--bd); }
.is-ok { color: var(--ok); }

.kinds { display: flex; flex-direction: column; gap: 8px; }
.kind { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border: 1px solid var(--ln); border-radius: 8px; background: var(--bg); }
.kind.is-detected { border-color: var(--accln); background: var(--accbg); }
.kind-mark:empty { display: none; }
.drop { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 18px 16px; border: 1px dashed var(--ln2); border-radius: 8px; background: var(--bg); }
.drop.is-over { border-color: var(--accm); background: var(--accbg); }
.drop .grow { flex: 1 1 240px; }
.import-side .kv dd .mono { flex: 1 1 0%; min-width: 0; overflow-wrap: anywhere; }
.import-side .note { overflow-wrap: anywhere; }
.drop-actions { display: flex; flex: none; flex-wrap: wrap; gap: 8px; }
label.btn { cursor: pointer; }

.preview-head { display: flex; align-items: center; gap: 10px; padding-bottom: 4px; }
/* The title is the address itself when the source gave no name, and it is shown whole. */
.preview-head .two b { overflow: visible; white-space: normal; overflow-wrap: anywhere; }
.roles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.role-pick { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 1px solid var(--ln2); border-radius: 8px; background: var(--bg); text-align: left; cursor: pointer; }
.role-pick small { color: var(--dim); font-size: 11.5px; }
.role-pick[aria-checked="true"] { border-color: var(--accln); background: var(--accbg); }

.steps-list { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; border: 1px solid var(--ln); border-radius: 8px; background: var(--bg); }
.step-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--ln); }
.step-row:last-child { border-bottom: 0; }
.step-n { flex: none; width: 18px; color: var(--dim); font: 600 11px var(--mono); }
/* A step's title names the place that does it, so it wraps rather than ending in an ellipsis. */
/* A step names a whole CID: it wraps where it must, never cut short. */
.step-row .two b { white-space: normal; overflow-wrap: anywhere; }

/* A name's preview: one row for each address its records point at, then the records that are not imported. Values wrap whole; nothing is cut. */
.dm-import { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.dm-targets .dm-target, .dm-others .dm-other { align-items: flex-start; }
.dm-target > input[type="checkbox"] { margin-top: 3px; }
.dm-target-body { flex: 1 1 0; gap: 4px; }
.dm-target-body label { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 6px; cursor: pointer; }
.dm-target-body small, .dm-other small { white-space: normal; overflow: visible; }
.dm-target-body .note, .dm-target-body .working-line, .dm-target-problem .note { overflow-wrap: anywhere; }
.dm-target-found { display: flex; flex-direction: column; gap: 3px; }
.dm-target-problem { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.dm-target-problem .note { margin: 0; flex: 1 1 200px; }
.dm-other .two { flex: 1 1 0; gap: 3px; }
.dm-other .two b { white-space: normal; overflow-wrap: anywhere; }
.dm-listing { align-items: flex-start; }
.dm-listing input[type="checkbox"] { margin-top: 3px; }
.dm-import .need-node { margin-top: 4px; }

/* The strip of what a Domain or a Pointer reaches, in its panel: a line for each Pointer, Block and replica, each one step further in than the line above it. */
.spine-lines .spine-line { align-items: flex-start; }
.spine-line > input[type="checkbox"] { margin-top: 3px; }
.spine-line.depth-1 { padding-left: 30px; }
.spine-line.depth-2 { padding-left: 46px; }
.spine-body { flex: 1 1 0; gap: 4px; min-width: 0; }
.spine-body label { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 6px; cursor: pointer; }
.spine-body small { white-space: normal; overflow: visible; }
.spine-body .note, .spine-body .working-line, .spine-line .dm-target-problem .note { overflow-wrap: anywhere; }
.spine-line.is-here .spine-body b, .spine-line.is-blocked .spine-body b { color: var(--dim); }
.spine-line .need-node { margin-top: 4px; }

@media (max-width: 1080px) { .import-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 599px) {
  .import-grid { padding: 0 14px 20px; }
  .tab-body, .card-body { padding-left: 14px; padding-right: 14px; }
  .roles { grid-template-columns: minmax(0, 1fr); }
}

/* The Block's full page: the chips and facts under the title, the strip under the action bar, and the two columns of cards. */
.bp-chips { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.page-note-wide { padding-top: 4px; }
.page-strip:empty, .page-need:empty { display: none; }
.page-strip, .page-need { padding: 0 20px 12px; }
.bp-facts { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 0; padding: 12px 20px 16px; border-top: 1px solid var(--ln); border-bottom: 1px solid var(--ln); background: var(--pn); }
.bp-fact { display: flex; align-items: center; gap: 8px; min-width: 0; }
.bp-fact dt { color: var(--dim); }
.bp-fact dd { margin: 0; display: flex; align-items: center; gap: 6px; font-weight: 500; }
.bp-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; padding: 16px 20px 24px; }
.bp-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.bp-col:empty { display: none; }
/* Long values wrap on the full page instead of being cut or pushing it sideways: an IPNS name, a topic, a reason. */
.bp-col .kv dd .mono { min-width: 0; overflow-wrap: anywhere; }
.bp-col .box-item .two b, .bp-col .box-item .two small { white-space: normal; overflow: visible; text-overflow: clip; }
.bp-col .box-item .mono { overflow-wrap: anywhere; text-align: right; }
.bp-col .note { overflow-wrap: anywhere; }

@media (max-width: 1080px) { .bp-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 599px) {
  .bp-grid { padding: 14px 14px 20px; }
  .bp-facts, .page-strip { padding-left: 14px; padding-right: 14px; }
}
