/* Legal entity structure chart — node/edge styling adapted from product.html */

.orym-structure-chart.mud-paper {
    background-color: var(--bg-2);
    border: 1px solid var(--hairline);
}

.orym-sc-canvas-wrap {
    width: 100%;
    overflow: auto;
    background: var(--bg);
    border: 1px solid var(--hairline);
    border-radius: 6px;
    padding: 8px;
}

.orym-sc-canvas {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
    font-family: var(--font);
}

/* Edges */
.orym-sc-edge {
    fill: none;
    stroke: var(--hairline);
    stroke-width: 1.2;
}

/* Wide, invisible hit target so thin edges are easy to click. */
.orym-sc-edge-hit {
    fill: none;
    stroke: transparent;
    stroke-width: 14;
    cursor: pointer;
}

.orym-sc-edge-group:hover .orym-sc-edge {
    stroke: var(--teal-1);
    stroke-width: 1.8;
}

/* Temporary line drawn while dragging a new relationship. */
.orym-sc-drag-line {
    fill: none;
    stroke: var(--teal-1);
    stroke-width: 1.6;
    stroke-dasharray: 4 3;
    pointer-events: none;
}

.orym-sc-arrowhead {
    /* Follow the stroke colour of the edge that references this marker. */
    fill: context-stroke;
}

.orym-sc-edge-label {
    fill: var(--fg-faint);
    font-size: 9px;
    font-weight: 400;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    paint-order: stroke;
    stroke: var(--bg);
    stroke-width: 3px;
}

/* Nodes */
.orym-sc-node {
    cursor: pointer;
}

.orym-sc-node-rect {
    fill: var(--bg-2);
    stroke: var(--hairline);
    stroke-width: 1.2;
    transition: fill 0.15s ease, stroke 0.15s ease;
}

.orym-sc-node:hover .orym-sc-node-rect {
    stroke: var(--teal-1);
    stroke-width: 1.6;
}

.orym-sc-node-title {
    fill: var(--fg);
    font-size: 11px;
    font-weight: 600;
}

.orym-sc-node-sub {
    fill: var(--fg-faint);
    font-size: 9px;
    font-weight: 400;
}

/* Type accents (left border via stroke colour) */
.orym-sc-node--company .orym-sc-node-rect {
    stroke: var(--teal-1);
}

.orym-sc-node--person .orym-sc-node-rect {
    stroke: var(--amber);
}

.orym-sc-node--asset .orym-sc-node-rect {
    stroke: var(--s-verified);
}

.orym-sc-node--company .orym-sc-node-sub {
    fill: var(--teal-1);
}

.orym-sc-node--person .orym-sc-node-sub {
    fill: var(--amber);
}

.orym-sc-node--asset .orym-sc-node-sub {
    fill: var(--s-verified);
}

/* Radial center node — emphasised so the focused entity stands out. */
.orym-sc-node--center .orym-sc-node-rect {
    fill: var(--bg);
    stroke: var(--teal-1);
    stroke-width: 2.4;
}

.orym-sc-node--center .orym-sc-node-title {
    font-weight: 700;
}

.orym-sc-center-picker {
    min-width: 220px;
}

/* Connector handle — revealed on node hover, drag it onto another node to link. */
.orym-sc-node-handle {
    fill: var(--teal-1);
    stroke: var(--bg);
    stroke-width: 2;
    opacity: 0;
    cursor: crosshair;
    transition: opacity 0.15s ease;
}

.orym-sc-node:hover .orym-sc-node-handle,
.orym-sc-node-handle:hover {
    opacity: 1;
}

/* Legal entity editor — expandable section titles (Relationships / Documents) */
.orym-le-sections {
    width: 100%;
}

.orym-le-sections .mud-expand-panel {
    background: transparent;
    border-bottom: 1px solid var(--hairline);
    box-shadow: none !important;
    margin: 0 !important;
}

.orym-le-sections .mud-expand-panel:last-child {
    border-bottom: none;
}

.orym-le-sections .mud-expand-panel-header {
    padding: 10px 4px;
    min-height: unset;
}

.orym-le-sections .mud-expand-panel-header .mud-expand-panel-text {
    margin: 0;
}

.orym-le-sections .mud-expand-panel-content {
    padding: 0 4px 12px;
}

.orym-le-sections .orym-le-docs-panel.mud-panel-expanded {
    border-right: 2px solid var(--teal-1);
}

.orym-le-section-title {
    color: var(--teal-1);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.orym-le-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 20px;
    padding: 0 6px;
    border: 1px solid var(--hairline);
    border-radius: 4px;
    background: transparent;
    color: var(--fg-faint);
    font-size: 11px;
    font-weight: 600;
}

/* Legal entity editor — documents list rows */
.orym-le-doc-list {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.orym-le-doc-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 4px;
    border-bottom: 1px solid var(--hairline);
    cursor: pointer;
    transition: background-color 0.12s ease;
}

.orym-le-doc-row:last-child {
    border-bottom: none;
}

.orym-le-doc-row:hover {
    background-color: var(--bg);
}

.orym-le-doc-code {
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--hairline);
    border-radius: 4px;
    background-color: var(--bg);
    color: var(--fg-faint);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.06em;
}

.orym-le-doc-main {
    flex: 1 1 auto;
    min-width: 0;
}

.orym-le-doc-title {
    color: var(--fg);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.orym-le-doc-sub {
    color: var(--fg-faint);
    font-size: 11px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.orym-le-doc-linked {
    flex: 0 0 auto;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    line-height: 1.2;
}
