.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-card {
    background-color: var(--hist-bg);
    color: var(--hist-text);
    width: 90%;
    max-width: 520px;
    border-radius: 6px;
    border: 1px solid var(--hist-border);
    box-shadow: 0 10px 25px rgba(0,0,0,0.4);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: modalSlideUp 0.2s ease-out;
}

@keyframes modalSlideUp {
    from { transform: translateY(20px); }
    to { transform: translateY(0); }
}

.modal-header {
    background-color: var(--hist-header);
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--hist-border);
}

.modal-header h3 {
    font-size: 1.3rem;
    color: #FFFFFF;
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    color: var(--hist-muted);
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
}

.modal-close:hover {
    color: var(--hist-text);
}

.modal-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    gap: 10px;
}

.detail-row.vertical {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}

.detail-label {
    font-weight: 600;
    color: var(--hist-muted);
}

.detail-value {
    font-weight: 500;
    text-align: right;
}

.detail-value.monospace {
    font-family: monospace;
    background: rgba(0,0,0,0.05);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
}

.detail-box-text {
    width: 100%;
    background-color: var(--hist-header);
    border: 1px solid var(--hist-border);
    padding: 10px;
    border-radius: 4px;
    font-size: 13px;
    color: var(--hist-text);
    font-style: italic;
}

.modal-divider {
    border: none;
    border-top: 1px dashed var(--hist-border);
    margin: 4px 0;
}

.modal-dropdown {
    width: 100%;
    background: var(--hist-input-bg);
    color: var(--hist-text);
    border: 1px solid var(--hist-border);
    padding: 8px 10px;
    border-radius: 4px;
    font-size: 14px;
}

.action-buttons-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    margin-top: 8px;
}

.action-trigger-btn {
    background-color: #2a2a2a;
    color: #ffffff;
    border: 1px solid #444444;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.action-trigger-btn:hover {
    background-color: #383838;
    border-color: #007acc;
}

.modal-card.mini-card {
    max-width: 480px;
    border-radius: 12px;
}

.modal-description-text {
    font-size: 14px;
    color: #b0b0b0;
    margin-bottom: 12px;
}

.monospace-textarea {
    width: 100%;
    background: #161616;
    color: #00ff66;
    font-family: 'Courier New', Courier, monospace;
    border: 1px solid #2a2a2a;
    padding: 10px;
    border-radius: 6px;
    resize: none;
    font-size: 13px;
    margin-bottom: 16px;
}

.modal-action-row {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    width: 100%;
}

.primary-action-btn {
    background-color: #007acc;
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
}

.primary-action-btn:hover { background-color: #005999; }

.secondary-action-btn {
    background: transparent;
    color: #cccccc;
    border: 1px solid #444444;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
}

.secondary-action-btn:hover { background: rgba(255,255,255,0.05); }

.no-actions-text {
    font-size: 13px;
    color: #777777;
    font-style: italic;
}

.modal-text-input {
    width: 100%;
    background-color: #1a1a1a;
    color: #ffffff;
    border: 1px solid var(--hist-border);
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.15s ease-in-out;
}

.modal-text-input:focus {
    border-color: #007acc;
    outline: none;
    background-color: #202020;
}

.command-box-wrapper.vertical {
    width: 100%;
    display: flex;
    flex-direction: column;
}
