/* Fill Pattern HD Modal */

.fp-hd-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fp-hd-modal[hidden] {
    display: none;
}

.fp-hd-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    cursor: pointer;
}

.fp-hd-modal__panel {
    position: relative;
    background: var(--page-background);
    color: var(--page-text);
    border: 1px solid var(--surface-muted);
    border-radius: 8px;
    box-shadow: var(--panel-shadow);
    display: flex;
    flex-direction: column;
    width: min(95vw, 900px);
    height: min(85vh, 580px);
    z-index: 1;
    overflow: hidden;
}

.fp-hd-modal__header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--surface-muted);
    flex-shrink: 0;
}

.fp-hd-modal__title {
    margin: 0;
    font-size: 1em;
    font-weight: bold;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fp-hd-modal__close {
    font-family: inherit;
    font-size: 1.1em;
    padding: 2px 8px;
    border: 1px solid var(--surface-muted);
    border-radius: 4px;
    background: var(--page-background);
    color: var(--page-text);
    cursor: pointer;
    line-height: 1.4;
    flex-shrink: 0;
}

.fp-hd-modal__close:hover {
    background: var(--surface-muted);
}

.fp-hd-modal__canvas {
    flex: 1;
    overflow: hidden;
    position: relative;
    min-height: 0;
}

.fp-hd-modal__canvas svg {
    display: block;
    width: 100%;
    height: 100%;
    user-select: none;
    -webkit-user-select: none;
    cursor: crosshair;
}

.fp-hd-modal__footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 14px;
    border-top: 1px solid var(--surface-muted);
    font-size: 0.8em;
    flex-shrink: 0;
    min-height: 26px;
    gap: 10px;
}

.fp-hd-modal__status {
    color: var(--muted-text);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fp-hd-modal__status--error {
    color: #f2495c;
}

.fp-hd-modal__selection {
    color: var(--page-text);
    font-weight: bold;
    white-space: nowrap;
    flex-shrink: 0;
    font-family: Inconsolata, monospace;
}

/* SVG chart element styles */

.fp-grid {
    stroke: var(--surface-muted);
    stroke-width: 1;
    fill: none;
}

.fp-border {
    stroke: var(--surface-muted);
    stroke-width: 1;
    fill: none;
}

.fp-axis-x,
.fp-axis-y,
.fp-unit {
    fill: var(--muted-text);
    font-size: 11px;
    font-family: Inconsolata, monospace;
}

.fp-axis-x {
    text-anchor: middle;
    dominant-baseline: hanging;
}

.fp-axis-y {
    text-anchor: end;
    dominant-baseline: middle;
}

.fp-unit {
    text-anchor: end;
    dominant-baseline: auto;
}

.fp-unit--x {
    text-anchor: middle;
    dominant-baseline: hanging;
}

.fp-line {
    stroke: rgb(86, 232, 252);
    fill: none;
    stroke-linecap: butt;
}

.fp-crosshair {
    stroke: var(--page-text);
    stroke-width: 1;
    stroke-dasharray: 4 2;
    fill: none;
    pointer-events: none;
    opacity: 0.6;
}

.fp-dot {
    fill: rgb(79, 226, 255);
    stroke: var(--page-background);
    stroke-width: 2;
    pointer-events: none;
}

html:not([data-theme='dark']) .fp-dot {
    fill: #1a1a1a;
    stroke: #ffffff;
}

.fp-status-text {
    fill: var(--muted-text);
    font-size: 13px;
    font-family: Inconsolata, monospace;
}

.fp-status-text--error {
    fill: #f2495c;
}

body.body--fp-hd-modal-open {
    overflow: hidden;
}
