.db-dialog-window {
    background: #ffffff;
    border-radius: 16px;
    width: 95%;
    max-width: 1200px;
    height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    position: relative;
    color: var(--text-primary);
    overflow: hidden;
}

.db-viewer-wrapper {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    padding-bottom: 1rem;
}

.db-viewer-content {
    overflow-y: auto;
    overflow-x: auto;
    background-color: #ffffff;
    border-radius: 12px;
    flex: 1;
    max-height: calc(85vh - 250px);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.db-table {
    width: 100%;
    border-collapse: separate;
    /* Required for sticky header border to look right, sometimes */
    border-spacing: 0;
    font-size: 0.75rem;
    white-space: nowrap;
    table-layout: fixed;
    /* Respect column widths strictly */
}

.removed-row td {
    text-decoration: line-through;
    color: var(--text-secondary);
    opacity: 0.7;
}

.db-table th,
.db-table td {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding: 0.75rem 1rem;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    box-sizing: border-box;
    /* Ensure padding is included */
    cursor: default;
    position: relative;
}

.db-table th {
    background-color: #fbfbfd;
    position: sticky;
    top: 0;
    font-weight: 600;
    color: var(--text-secondary);
    z-index: 10;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.7rem;
}

.db-table tr:hover {
    background-color: #f5f5f7;
}

.db-id-col {
    font-family: monospace;
    color: var(--text-secondary);
    white-space: nowrap;
}

.db-clear-btn {
    background: transparent;
    border: 1px solid #ff3b30;
    color: #ff3b30;
    border-radius: 100px;
    padding: 4px 12px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    font-weight: 600;
}

.db-clear-btn:hover {
    background: #ff3b30;
    color: white;
}

.db-action-btn {
    background: transparent;
    border: 1px solid #9b7dd4;
    color: #9b7dd4;
    border-radius: 100px;
    padding: 4px 12px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    font-weight: 600;
}

.db-action-btn:hover {
    background: #9b7dd4;
    color: white;
}

.db-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}

.db-nav-btn {
    background: transparent;
    border: 1px solid #9b7dd4;
    color: #9b7dd4;
    border-radius: 4px;
    padding: 4px 12px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    font-weight: 600;
    min-width: 36px;
}

.db-nav-btn:hover:not(:disabled) {
    background: #9b7dd4;
    color: white;
}

.db-nav-btn:disabled {
    cursor: not-allowed;
    opacity: 0.3;
}

/* スピナーアニメーション */
.spinner {
    display: inline-block;
    width: 30px;
    height: 30px;
    border: 3px solid rgba(155, 125, 212, 0.2);
    border-top-color: #9b7dd4;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}